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
sdavidow9sdavidow9 

VF Email Template Date/Time formatting for timezone

Hi, I've got a VF email template that includes a datetime field:

{!relatedto.Appointment_Scheduled_DateTime__c}

 

This displays the GMT date/time, so a prior admin created a field called Well_Formatted_Time__c, that simply sets it back 6 hours, but that only works for 1 timezone and only during Daylight Savings.

 

I tried this:

   <apex:outputText value="Your Appointment is at:
         {0,date,MMMM, d 'at' h:mm a}">
<apex:param value="{!relatedTo.Appointment_Scheduled_DateTime__c}}" />
   </apex:outputText> 

 

But again...only GMT.

 

Is there anyway to get the email template to show the local timezone of the sending user, AND can this be done without having to add in a custom controller?  If so, how do I do that?

 

Thanks...