[SalesForce] Created Date time difference

So I have a visualforce page displaying a query. But when it is being display on a force.com sites page. The created dates are different.

Visualforce page inside sandbox:
enter image description here

Visualforce page on force.com sites:
enter image description here

Here's the query to get the items

purchaseRequest = [select id, name, CreatedBy.Name, Selected_Request__c, Ownerid, CreatedDate
                            from Purchase_Request__c 
                            where Purchase_Request__c.CreatedDate = TODAY];

As you can see, line item PR-00000016 has a datetime 2/25/2014 8:07am for the visualforce page view inside the sandbox environment. Which is PST at time of creation. But the visualforce page that is being viewed through the force.com site public view is show a datetime 2/25/2014 4:07pm for PR-0000016.

My only conclusion is that the server that host the force.com site for me is in another country and is displaying the date in their time zone. Does anyone have any other idea?

I won't be able to use this to display for our customers if this is happening. Is there a way to set time zones for force.com sites?

Best Answer

Keep in mind, this could be timezone differences. Most likely when you are logged in, created date is converted to your current user's timezone, while in sites it's most likely GMT. Please add your timezone to your create date format and you'll be able to determine if this is the case.

<apex:outputText value="string: {0,date,yyyy.MM.dd 'at' HH:mm:ss z}"> 
    <apex:param value="{!account.CreatedDate}" /> 
</apex:outputText>

Link to your simple date format doc