Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home/Support and troubleshooting/Examples and how to

How to change the date and time formats in Word templates

Last updated on 19 September 2023

Admin
Microsoft Office Add-ins

Overview

This document describes changing the date and time formats in Microsoft Word templates. The method also supports PDF conversion, which is made on the M-Files server side.

Solution

Open the wanted template for editing, go to where you have added M-Files placeholders, and press [Alt] + F9 to reveal the field coding. Or, right-click on the field and choose the Toggle Field Code option. 

For example, if you want to change document date property format, the original format looks like this:

image.png

To change the document date property format, replace \* with \@ followed by the required format options. Here is an example: \@ "dddd, MMMM d, yyyy"

The modified line looks like this:

image.png

Here is a short description of what these options do:

  • dddd = This format item displays the day of the week using the day's full name.
  • MMMM = This format item displays the month as the month's full name.
  • d = This format item displays the day of the week or month as a number without a leading 0 (zero) for single-digit days. For example, the sixth day of the month is displayed as 6.
  • yyyy = This format item displays the year as four digits.

Now, when a new document is created from the template, the date format looks like this:

To see all possible date and time format options, please see the reference document.

By using different date and time formats, you can create separate templates for different regions and your documents will use correct formatting.

Reference Documents

https://support.microsoft.com/en-us/office/format-field-results-baa61f5a-5636-4f11-ab4f-6c36ae43508c#ID0EBBD=Date-Time_format_switch_(\@)

Still need help?