function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
GranicusJayGranicusJay 

Converting Date/Time fields from GMT to PST

All,

 

I have a custom object called "Deployment Project" that contains a few dozen project milestone dates and times. When entered into SFDC, these dates and times appear in the SFDC user's current timezone.

 

The deployment project record is visible to our users as a Visualforce page published through Sites. When clients are viewing the page, the date/time fields all show in GMT.This is not very customer friendly and causes problems with the scheduling of events.

 

The code we're using for the fields to show date/time is as follows:

 

 <apex:outputText styleClass="milestoneCol3" value="{0,date,MM/dd/yyyy hh:mm}">

  <apex:param value="{!Deployment_Project__c.New_Client_Tutorial__c}" />
</apex:outputText>
 

This produces an output of:

 

12/05/2009 12:23

 

 

We need to convert the date/time output to a specific timezone, specifically Pacific Standard Time. 

 

Can this be done in the VisualForce page code, or do we need to do this in the APEX class?

housingworkshousingworks
Just posted about the exact same problem, someone must know how to do what must be such a basic task?
sfuser2010sfuser2010

Did you guys find a way around this?

antonrealmantonrealm

Looks like you need to use a custom component/controller : http://www.salesforce.com/us/developer/docs/pages/Content/pages_email_templates_with_apex.htm to return the dates in PST.