KBA-01132: Full List of Supported Date/Time Formats for Bookmark Aliases

Question:

What are all the supported Date/Time formats for Bookmark Aliases in Bookmark Templates?

Answer:

Date formatting in Microsoft Word bookmarks

All our format specifiers start with an F and are followed by an underscore_.  So, for example, F in the list below refers to FF_.  FF_ is used by default if no format specifier is included.
The following table lists abbreviations or shortcuts for formatting, for example FD_DocHeader_Due = July 06, 2005 5:00 PM.

Format Character Associated Property/ Description
d ShortDatePattern
D LongDatePattern
f Full date and time (long date and short time)
F FullDateTimePattern (long date and long time) dddd, dd MMMM yyyy HH:mm:ss
g General (short date and short time)
G General (short date and long time)
m, M MonthDayPattern
r, R RFC1123Pattern
s SortableDateTimePattern (based on ISO 8601) using local time
t ShortTimePattern
S Same as dbt = ShortDatePattern Space ShortTimePattern
T LongTimePattern
u UniversalSortableDateTimePattern using the format for universal time display
U Full date and time (long date and long time) using universal time
y, Y YearMonthPattern

Note: FS_ is equivalent to Fdbt_

The following table lists the patterns that can be combined to construct custom patterns. The patterns are case-sensitive; for example, ‘MM‘ is recognized, but ‘mm‘ is not. If the custom pattern contains white-space characters or characters enclosed in single quotation marks, the output string will also contain those characters. Characters not defined as part of a format pattern or as format characters are reproduced literally.

Format Pattern Description
bc blank
, (comma)
d The day of the month. Single-digit days will not have a leading zero.
dd The day of the month. Single-digit days will have a leading zero.
ddd The abbreviated name of the day of the week, as defined in AbbreviatedDayNames.
dddd The full name of the day of the week, as defined in DayNames.
M The numeric month. Single-digit months will not have a leading zero.
MM The numeric month. Single-digit months will have a leading zero.
MMM The abbreviated name of the month, as defined in AbbreviatedMonthNames.
MMMM The full name of the month, as defined in MonthNames.
y The year without the century. If the year without the century is less than 10, the year is displayed with no leading zero.
yy The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.
yyyy The year in four digits, including the century.
gg The period or era. This pattern is ignored if the date to be formatted does not have an associated period or era string.
h The hour in a 12-hour clock. Single-digit hours will not have a leading zero.
hh The hour in a 12-hour clock. Single-digit hours will have a leading zero.
H The hour in a 24-hour clock. Single-digit hours will not have a leading zero.
HH The hour in a 24-hour clock. Single-digit hours will have a leading zero.
m The minute. Single-digit minutes will not have a leading zero.
mm The minute. Single-digit minutes will have a leading zero.
s The second. Single-digit seconds will not have a leading zero.
ss The second. Single-digit seconds will have a leading zero.
f The fraction of a second in single-digit precision. The remaining digits are truncated.
ff The fraction of a second in double-digit precision. The remaining digits are truncated.
fff The fraction of a second in three-digit precision. The remaining digits are truncated.
ffff The fraction of a second in four-digit precision. The remaining digits are truncated.
fffff The fraction of a second in five-digit precision. The remaining digits are truncated.
ffffff The fraction of a second in six-digit precision. The remaining digits are truncated.
fffffff The fraction of a second in seven-digit precision. The remaining digits are truncated.
t The first character in the AM/PM designator defined in AMDesignator or PMDesignator, if any.
tt The AM/PM designator defined in AMDesignator or PMDesignator, if any.
Z The time zone offset (‘+‘ or ‘-‘ followed by the hour only). Single-digit hours will not have a leading zero. For example, Pacific Standard Time is ‘-8‘.
Zz The time zone offset (‘+‘ or ‘-‘ followed by the hour only). Single-digit hours will have a leading zero. For example, Pacific Standard Time is ‘-08‘.
zzz The full time zone offset (‘+‘ or ‘-‘ followed by the hour and minutes). Single-digit hours and minutes will have leading zeros. For example, Pacific Standard Time is ‘-08:00‘.
X The default time separator defined in TimeSeparator.
x (lower case) The default date separator

 

For example, FdxMMMbyyyybhXmmt_DocHeader_DocDate would expand to 8/Jul 2005 12:00A

Additional Comments:

Note: Z for Time Zone is always blank since Spitfire does not store time zone data.Available in Release 1.1.2015.20021 and higher.  See also KBA-01131.For more examples and information, see the Focus on Bookmark Templates guide.


KBA-01132; Last updated: April 9, 2019 at 17:40 pm;
Keywords:  Doc Templates, Bookmarks