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
JaxBeachJaxBeach 

International Date Format Question

I'm trying to do a formula for an international date field in an HTML email template and I haven't been able to find out how to do it through the help desk or blogs.

 

I'm currently using {!Today} to get M/DD/YYYY =  7/23/2010,

 

but I need it to show YYYY-MM-DD so that it shows 2010 - 07- 23.

 

Does anyone know a formula I can use to get this output?  Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

You might want to try creating a custom Formula(Text) field and use a combination of YEAR, MONTH, DAY functions to reformat the date, and use that in your Email template

 

 

TEXT(YEAR(TODAY())) +"-"+ TEXT(MONTH(TODAY())) +"-"+ TEXT(DAY(TODAY()))

 

 

All Answers

Steve :-/Steve :-/

You might want to try creating a custom Formula(Text) field and use a combination of YEAR, MONTH, DAY functions to reformat the date, and use that in your Email template

 

 

TEXT(YEAR(TODAY())) +"-"+ TEXT(MONTH(TODAY())) +"-"+ TEXT(DAY(TODAY()))

 

 

This was selected as the best answer
JaxBeachJaxBeach

Awesome - it worked!  You Rock - thanks for your help with this

DarrenWolfDarrenWolf

 


Stevemo wrote:

You might want to try creating a custom Formula(Text) field and use a combination of YEAR, MONTH, DAY functions to reformat the date, and use that in your Email template

 

 

TEXT(YEAR(TODAY())) +"-"+ TEXT(MONTH(TODAY())) +"-"+ TEXT(DAY(TODAY()))

 

 


 

Greetings from Bluewolf!

 

I would like to thank Stevemo for finding this solution. Adjusting the header formats to the dates on outgoing e-mails to YYYY-MM-DD is an interesting problem with a simple and elegant answer. I would like to offer a step-by-step guide on how to impliment this formula for less experienced users.

 

1) Click on Setup

 

2) Expand the "E-mail" Object under Personal Settings, Then Click on "My Templates"

 

3) Choose the Folder in which you wish to store your new template (Unfiled Public E-mail Templates, My Personal E-mail Templates, or some other Folder you have already created) Then click on "New Template"

 

4) Select the Text option, Then click "Next"

 

5) Select your available merge feilds if desired.

 

6) Enter the name of your new template in the required fields titled "Email Template Name" & "Template Unique Name"

 

7) Enter the Subject of the e-mail template.

 

8) In the E-mail body feild enter the following formula where you want the date to appear:

 

{!TEXT(YEAR(TODAY())) +"-"+ TEXT(MONTH(TODAY())) +"-"+ TEXT(DAY(TODAY()))}

 

9) Click on the "Save" button

 

Again, thanks to Stevemo we can see that modifiying dates on outgoing email headers is a simple process. I hope this guide has made it even clearer.

 

Thank You,

 

DarrenWolf

Bluewolf.com