New Date-Time $Locale Attributes

The $Locale global value provider has new attributes for date-time formatting. $Locale returns information about the current user’s preferred locale.

Where: This change applies to orgs with Lightning components in Lightning Experience, Salesforce Classic, and all versions of the Salesforce app.

How: Here are the new attributes with sample output for English (United States).

Attribute Description Sample Output
longDateFormat Long date format. "MMMM d, yyyy"
shortDateFormat Short date format. "M/d/yyyy"
shortDatetimeFormat Short date time format. "M/d/yyyy h:mm a"
shortTimeFormat Short time format. "h:mm a"