The date format switch (\@) displays Salesforce date fields in the format you choose in your Word templates. Use it to show dates in a clear format that suits your audience or business standards.

Syntax

{{Object.DateField \@ "Pattern"}}

The quotation marks around the pattern are optional: \@ "dd-MM-yyyy" and \@ dd-MM-yyyy both work.

Values

Pattern is a combination of date specifiers. Letter case matters: MM is the month and mm is minutes.

SpecifierEffectExample output
ddDay, with a leading zero03
dDay, without a leading zero3
MMMonth as a number06
MMMShort month nameJun
MMMMFull month nameJune
yyyyYear2025

Without a switch, the date appears in a default format (wrong date format).

Where to add it

Add \@ and the pattern after the field name inside the merge field in your Word template.

Example

Input: an account whose Created Date is 3 June 2025.

FormatSyntaxOutput
Day-month-year (European/international){{Account.CreatedDate \@ "dd-MM-yyyy"}}03-06-2025
Month-day-year (US standard){{Account.CreatedDate \@ "MM-dd-yyyy"}}06-03-2025
Day/month/year (EU style){{Account.CreatedDate \@ "dd/MM/yyyy"}}03/06/2025
Month/day/year (US style){{Account.CreatedDate \@ "MM/dd/yyyy"}}06/03/2025
Abbreviated month{{Account.CreatedDate \@ "MMM dd, yyyy"}}Jun 03, 2025
Full month{{Account.CreatedDate \@ "MMMM dd, yyyy"}}June 03, 2025
Full month, no leading zero{{Account.CreatedDate \@ "MMMM d, yyyy"}}June 3, 2025

Works in

Word (DOCX) templates: every example on this page is a Word template field.

Notes

  • Some patterns, such as "MMMM d, yyyy", don't add a leading zero to the day (3 instead of 03). This is standard Word formatting behavior.
  • To show times and AM/PM, see Time and AM/PM.

Common errors