The time format switch (\@) shows time values in 12-hour format, with or without an AM/PM indicator, so readers can tell morning from evening times.
Syntax
{{FieldName \@ MM-dd-yyyy hh:mm a}}
Values
The pattern starts after \@ and uses standard date and time specifiers. Letter case matters: mm is minutes and MM is the month.
| Format | Syntax | Effect |
|---|---|---|
| 12-hour without AM/PM | {{FieldName \@ MM-dd-yyyy hh:mm}} | Standard 12-hour format |
| 12-hour, single-digit hour and minute | {{FieldName \@ MM-dd-yyyy h:m}} | Minimal 12-hour format |
| 12-hour with AM/PM | {{FieldName \@ MM-dd-yyyy hh:mm a}} | Standard 12-hour format with AM/PM |
| 12-hour minimal with AM/PM | {{FieldName \@ MM-dd-yyyy h:m a}} | Compact format with AM/PM |
The source field must be a DateTime field for the output to be correct.
Where to add it
Add \@ and the pattern after the field name inside the merge field in your Word template.
Example
Input: an account created on 9 July 2025 at 6:47 in the evening (a DateTime field).
| Syntax | Output |
|---|---|
{{Account.CreatedDate \@ MM-dd-yyyy hh:mm}} | 07-09-2025 06:47 |
{{Account.CreatedDate \@ MM-dd-yyyy hh:mm a}} | 07-09-2025 06:47 PM |
Works in
Word (DOCX) templates: the examples on this page are Word template fields.
Common errors
- The time is several hours early or late. Salesforce stores DateTime values in UTC; the document may show a different time zone from yours. See Dates, numbers or currency show the wrong format.
- No time appears, or it shows 12:00. Times only appear if the field is a DateTime field, not a Date field.
- The month appears where the minutes should be, or the other way round. Use
mmfor minutes andMMfor the month. - The document shows the tag instead of the time. Retype the whole tag in one go. See Merge fields are blank or show their tags.