function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Hi,
I want to ask a question, is it possible to format the date field in Email template? Any suggestions would be great.
regards,
Edwin
Edwin,
You can do a format, but only through a Visualforce Email Template. With the VF Template, you can enforce a format using apex:outputText (
http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_compref_outputText.htm?SearchType=Stem):
<messaging:emailTemplate subject="Testing Date" recipientType="User" relatedToType="Account"> <messaging:plainTextEmailBody > <apex:outputText value="The formatted Account CreatedDate is: {0,date,yyyy.MM.dd G 'at' HH:mm:ss z}"> <apex:param value="{!relatedTo.createddate}" /> </apex:outputText> </messaging:plainTextEmailBody> </messaging:emailTemplate>
This will output an email like:
The formatted Account CreatedDate is: 2010.08.24 AD at 16:50:19 GMT
Hope that helps.
Jay
Yes, that's a great help. Thanx a lot for solutions you gave me..
This will return tome in GMT time zone
If you want to show the same in user's time zone take a look here
Visualforce Email template to display date and time in User's timezone (local time)
Edwin,
You can do a format, but only through a Visualforce Email Template. With the VF Template, you can enforce a format using apex:outputText (
http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_compref_outputText.htm?SearchType=Stem):
This will output an email like:
The formatted Account CreatedDate is: 2010.08.24 AD at 16:50:19 GMT
Hope that helps.
Jay
All Answers
Edwin,
You can do a format, but only through a Visualforce Email Template. With the VF Template, you can enforce a format using apex:outputText (
http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_compref_outputText.htm?SearchType=Stem):
This will output an email like:
The formatted Account CreatedDate is: 2010.08.24 AD at 16:50:19 GMT
Hope that helps.
Jay
Yes, that's a great help. Thanx a lot for solutions you gave me..
regards,
Edwin
This will return tome in GMT time zone
If you want to show the same in user's time zone take a look here
Visualforce Email template to display date and time in User's timezone (local time)
{!CASE(MONTH(Case.CreatedDate),1,"January",2,"February",3,"March",4,"April",5,"May",6,"June",7,"July",8,"August-",9,"September",10,"October",11,"November",12,"December","-???-")} {!DAY(Case.CreatedDate)}, {!YEAR(Case.CreatedDate)}