Snippet date format

  • 1
  • Question
  • Updated 3 weeks ago
  • In Progress
I am trying to change the date format of a model field on snippet to MMDDYYYY. Is there a formating method allows me to do like this.
Photo of Kumar

Kumar

  • 70 Points

Posted 3 weeks ago

  • 1
Photo of Conlan O'Rourke

Conlan O'Rourke

  • 3,280 Points 3k badge 2x thumb
Kumar, I would recommend using a UI-Only formula field instead...no need for a snippet to do that.

In your formula, use the following function

FORMAT_DATE( "mmddyy",{{Your_Date_Field_Here__c}} )




I use that formula all the time with various date formats (see date formatting options here), for example:

FORMAT_DATE("MM d, yy" , {{Your_Date_Field_Here__c}} )




FORMAT_TIME formula is also great in case you want to display a datetime field in a very reader-friendly manner, for example:

FORMAT_TIME("h:mm a",{{Your_Datetime_Field_Here__c}})