You set a custom time format in your Word mail merge document, but the final output shows times in a 24-hour style instead of the 12-hour format you specified. This problem occurs because Word’s merge engine reads the raw time value from the data source and applies its own default formatting, ignoring the format switch you added to the merge field. This article explains why the formatting reverts, provides a reliable fix using field codes and switches, and covers related issues like date formatting and regional setting conflicts.
Key Takeaways: Fixing Mail Merge Time Format to 12-Hour Style
- Alt+F9 to reveal field codes then add the \@ “h:mm AM/PM” switch: Overrides Word’s default 24-hour output for time merge fields.
- Data source time stored as text vs serial number: Text-based times require a different field code approach to format correctly.
- Regional format settings in Windows: Can interfere with merge output; using explicit switches bypasses these settings.
Why Word Mail Merge Ignores Your Custom Time Format
When you insert a time merge field, Word stores the raw value from your data source. If the data source contains a time stored as a serial number or as text, the merge engine processes it differently. For serial number times, Word defaults to the system’s short time format, which on many Windows systems is set to 24-hour style (HH:mm). Even if you click the field and apply a time format through the Ribbon, those formatting choices are not preserved during the merge. The merge engine reads the field code and applies its own formatting rules unless you add a format switch directly to the field code.
How Field Codes and Switches Work
Every merge field is represented by a field code. By default, a time merge field looks like { MERGEFIELD Time }. To control the output format, you add a format switch: \@ "h:mm AM/PM". This switch tells Word exactly how to display the time, overriding both the data source format and the system regional settings. Without this switch, Word uses the default short time pattern from Windows, which is often 24-hour style.
Text-Based Time Values
If your data source contains time values stored as text such as “14:30”, the format switch still works because Word can parse common time text patterns. However, if the text is irregular, you may need to pre-process the data in the source file or use a calculated field in the merge document.
Steps to Add a Format Switch to a Time Merge Field
Follow these steps to force a 12-hour time format with AM/PM in your mail merge output. The process works in Word 2016, Word 2019, Word 2021, and Word for Microsoft 365.
- Open the mail merge document and show field codes
Press Alt+F9 on your keyboard. This toggles the display from merge field results to the underlying field codes. You will see something like{ MERGEFIELD Time }instead of a time value. - Locate the time merge field
Scroll through the document and find the field code that corresponds to the time. If you have multiple time fields, repeat the next step for each one. - Add the format switch
Click inside the field code just after the field name. Type a space, then add the following switch:\@ "h:mm AM/PM". The complete field code should look like this:{ MERGEFIELD Time \@ "h:mm AM/PM" }. Make sure you include the backslash and the @ symbol. - Close field codes view
Press Alt+F9 again to hide the field codes and see the formatted result. If you have preview results enabled, you should now see times displayed as 2:30 PM instead of 14:30. - Run a test merge
Click Mailings > Preview Results to verify the formatting for several records. Then complete the merge by clicking Finish & Merge > Edit Individual Documents or Print Documents.
Alternative Format Switches
You can customize the time output by changing the picture string inside the switch. Common examples include:
\@ "h:mm:ss AM/PM"for hours, minutes, and seconds with AM/PM\@ "h:mm"for 12-hour time without AM/PM\@ "HH:mm"to force 24-hour time explicitly
If the Format Switch Does Not Work
In some cases, the format switch does not change the output. This usually happens when the data source contains time values stored as text in a non-standard format, or when the merge field is nested inside another field such as an IF or a calculation.
“Time Still Shows as 14:30 After Adding the Switch”
Check the data source. Open the Excel sheet or Access table that supplies the data. Ensure the time column is formatted as Time, not as Text. If it is text, convert it using Excel’s TIMEVALUE function or change the column format to Time. Then refresh the merge document by clicking Mailings > Select Recipients > Use an Existing List and re-selecting the file.
“Date Merge Fields Also Show Wrong Format”
The same principle applies to dates. Add the switch \@ "MMMM d, yyyy" to a date merge field to get output like “March 15, 2025”. Without a switch, Word uses the system short date format, which may display as “3/15/2025” or “15/03/2025” depending on your region.
“The Switch Works in Preview but Not in Final Output”
This can occur if you use the Finish & Merge > Send Email Messages option. Some email merge settings strip field formatting. Use Finish & Merge > Edit Individual Documents instead, then copy the output to your email manually.
Mail Merge Time Format: Field Code Switch vs Data Source Format
| Item | Field Code Switch | Data Source Format |
|---|---|---|
| Control location | Inside the Word document field code | In the source file (Excel, Access, CSV) |
| Format override | Overrides all other formatting instructions | Ignored by Word during merge unless switch is present |
| Requires field code editing | Yes, Alt+F9 is needed | No, but must match a parseable time pattern |
| Works with text time values | Yes, if the text is a standard time pattern | Not recommended; text often causes formatting loss |
| Affected by Windows region settings | No, the switch is explicit | Yes, the default short time format is used |
| Best practice | Always add the switch for consistent output | Keep as Time serial number for reliable parsing |
Conclusion
You can now force Word to display times in 12-hour AM/PM format by adding the \@ "h:mm AM/PM" switch to the merge field code. This method works regardless of your Windows regional settings or the data source formatting. After fixing the current document, review any other date or time merge fields and add the appropriate switches. As an advanced tip, consider saving a template document with the switches already applied so you do not have to edit field codes for every new merge.