Formatting Issues

How to Create a Custom YMM Date Format in Microsoft Word

Emma BrownEmma Brown Oct 9, 2026 871 views

Question details

The user needs to generate a specific three-digit date code consisting of a single-digit year and a two-digit month (e.g., 312 for December 2023) in a document template.

How to Create a Custom YMM Date Format in Word
Product
Microsoft Word
Device & OS
not provided
Scenario
Creating a custom document template that requires an exact three-digit date format to streamline data entry or tracking codes.
Observed behavior
Native Word date fields and date picker controls do not consistently support a single-digit year format, often outputting four digits (such as 2312) when using the yMM format switch.
Before you start

Ensure you have basic familiarity with Word's field codes, and consider enabling the Developer tab if you need to use VBA macros for strict formatting control.

Solution 1Recommended

Use Field Codes for YMM Formatting

Modify Word's built-in Date field to approximate the YMM layout using field switches.

Microsoft Word allows users to customize date outputs using field switches. While the 'y' switch attempts to isolate the year, be aware that depending on your Word version and the current year, it might yield a two-digit year instead of a single digit.

1
Insert a Date Field

Navigate to the 'Insert' tab on the Word ribbon, click on 'Quick Parts' in the Text group, and select 'Field'.

2
Select the Date Category

In the Field dialog box, select 'Date and Time' from the Categories dropdown, then choose 'Date' from the Field names list.

3
Edit the Field Code

Click the 'Field Codes' button at the bottom left. In the advanced view, type the format switch directly into the code box so it reads: { DATE \@ "yMM" }.

4
Update and Test

Click 'OK' to insert the field. Right-click the inserted date and select 'Update Field' to see the result. Verify if the output matches your required three-digit format.

Use Field Codes for YMM Formatting
Formatting Limitations: Because the 'yMM' switch may output four digits (like 2312 for December 2023), you must test this in your specific environment. If a strict three-digit code is mandatory, a macro is required.

Manage Custom Field Codes Easily with WPS Writer

WPS Office provides a highly compatible, lightweight, and intuitive environment for handling complex document fields. You can seamlessly insert and edit custom date formats exactly as you would in Microsoft Word.

  1. 1. Open Your Document in WPS Writer: Launch WPS Office and open your existing document or create a new template.
  2. 2. Access the Field Menu: Navigate to the 'Insert' tab, click on 'Field' to open the field management dialog box.
  3. 3. Apply Custom Date Formatting: Select the 'Date and Time' category, insert a Date field, and modify the field code to { DATE \@ "yMM" }.
  4. 4. Update the Field: Right-click the inserted field and choose 'Update Field' or simply press F9 to refresh the date output instantly.
Fully compatible with Microsoft Word DOCX files and field codesIntuitive interface for easily updating and formatting date fieldsFree and lightweight alternative to Microsoft OfficeSupports advanced document automation and formatting requirements
microsoft office alternative - wps office

Frequently Asked Questions

Why does my yMM date field show four digits instead of three?

In Word, the 'y' format switch can sometimes default to a two-digit year depending on the system's date settings and the specific year. When combined with a two-digit month (MM), this results in a four-digit output (e.g., 2312) instead of the desired three.

Can I use a Date Picker Content Control for this specific format?

While Date Picker Content Controls allow you to specify custom date formats in their properties, they rely on the same underlying formatting rules as field codes. They may still fail to produce a strict single-digit year.

How do I edit an existing date field code in Word?

To edit an existing field, select the date text in your document and press 'Alt + F9' to toggle the display of field codes. You can then manually change the text inside the brackets, for example updating it to { DATE \@ "yMM" }. Press 'Alt + F9' again to hide the codes, and press F9 to update the result.