Add a formatting switch to a field code
- Right-click the field, and then click Edit Field.
- Do one of the following:
- If Field properties and Field options are displayed, select the formatting options that you want.
- If only the field code is displayed, click Options, and then select the formatting options that you want.
If the Options button appears dimmed, additional formatting options may not be available.
Date-Time format switch
The Date-Time format switch (\@) specifies the display of a date or time.
For example, the switch \@ "dddd, MMMM d, yyyy" in the field { DATE \@ "dddd, MMMM d, yyyy" } displays "Friday, November 23, 2007." Combine the following date and time instructions — day (d), month (M), and year (y); hours (h) and minutes (m) — to build a date-time format. You can also include text, punctuation, and spaces.
Date instructions
Month (M)
The letter M must be uppercase to distinguish months from minutes.
- M This format item displays the month as a number without a leading 0 (zero) for single-digit months. For example, July is 7.
- MM This format item displays the month as a number with a leading 0 (zero) for single-digit months. For example, July is 07.
- MMM This format item displays the month as a three-letter abbreviation. For example, July is Jul.
- MMMM This format item displays the month as its full name.
Day (d)
The letter d displays the day of the month or the day of the week. The letter d can be either uppercase or lowercase.
- 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.
- dd This format item displays the day of the week or month as a number with a leading 0 (zero) for single-digit days. For example, the sixth day of the month is displayed as 06.
- ddd This format item displays the day of the week or month as a three-letter abbreviation. For example, Tuesday is displayed as Tue.
- dddd This format item displays the day of the week as its full name.
Year (y)
The letter y displays the year as two or four digits. The letter y can be either uppercase or lowercase.
- yy This format item displays the year as two digits with a leading 0 (zero) for years 01 through 09. For example, 1999 is displayed as 99, and 2006 is displayed as 06.
- yyyy This format item displays the year as four digits.
Time instructions
Hours (h)
A lowercase h bases time on the 12-hour clock. An uppercase H bases time on the 24-hour, or military, clock; for example, 5 P.M. is displayed as 17.
- h or H This format item displays the hour without a leading 0 (zero) for single-digit hours. For example, the hour of 9 A.M. is displayed as 9.
- hh or HH This format item displays the hour with a leading 0 (zero) for single-digit hours. For example, the hour of 9 A.M. is displayed as 09.
Minutes (m)
The letter m must be lowercase to distinguish minutes from months.
- m This format item displays minutes without a leading 0 (zero) for single-digit minutes. For example, { TIME \@ "m" } displays 2.
- mm This format item displays minutes with a leading 0 (zero) for single-digit minutes. For example, { TIME \@ "mm" } displays 02.
A.M. and P.M. (AM/PM)
This displays A.M. and P.M. To change the A.M. and P.M. symbols for Microsoft Windows, change the regional settings in Control Panel.
- am/pm or AM/PM This format item displays A.M. and P.M. as uppercase. For example, { TIME \@ "h AM/PM" } and { TIME \@ "h am/pm" } display 9 AM or 5 PM.