[SalesForce] Changing date format on the email template

I have added a field called Desired Ship Date on to my email template. when I tested the email template the Desired Ship Date is being shown in the following format "Desired Ship Date: Thu Sep 29 00:00:00 GMT 2016 " but I need it to be displayed in different format like "Desired Ship Date: Thu Sep 29 2016 ". Is there a way I can do it. If yes, Can you let me know how.

Best Answer

The best bet is to use <apex:outputField /> to display your value. This will use the User's date preferences for formatting. If you cannot use that because you are not working with an sObject, see this: Visualforce Date formatting

Related Topic