Date and time format settings
Some system variables available in an HelpNDoc project can output current date and time information. The following variables are available and will be replaced by the current date and time value at generation time:
Variable name |
Meaning |
Current Date/Time |
Display the current date and time |
Date |
Display the current date, short format |
Date - long |
Display the current date, long format |
Day |
Display the current day, short format |
Day - long |
Display the current day, long format |
Month |
Display the current month, short format |
Month - long |
Display the current day, long format |
Time |
Display the current time, short format |
Time - long |
Display the current time, long format |
Year |
Display the current year, short format |
Year - long |
Display the current year, long format |
Customizing the formats
By default, the date and time variables are displayed based on the project's language settings. It is possible to customize the format for each of those system variables using the "Date / Time format options" dialog.
To show the date and time customization dialog: from the "Home" ribbon tab, click "Project options" then "Customize" next to "Date / Time format" in the "Language settings". The following table explains the various specifiers which can be used when formatting date and time settings:
Specifier |
Displays |
d |
Displays the day as a number without a leading zero (1-31) |
dd |
Displays the day as a number with a leading zero (01-31) |
ddd |
Displays the day as an abbreviation (Sun-Sat) using the translated strings according to project language |
dddd |
Displays the day as a full name (Sunday-Saturday) using the translated strings according to project language |
ddddd |
Displays the date using the format given by Windows' short date format |
dddddd |
Displays the date using the format given by Windows' long date format |
e |
Displays the year in the current period/era as a number without a leading zero (Japanese, Korean, and Taiwanese locales only) |
ee |
Displays the year in the current period/era as a number with a leading zero (Japanese, Korean, and Taiwanese locales only) |
g |
Displays the period/era as an abbreviation (Japanese and Taiwanese locales only) |
gg |
Displays the period/era as a full name (Japanese and Taiwanese locales only) |
m |
Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed |
mm |
Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed |
mmm |
Displays the month as an abbreviation (Jan-Dec) using the translated strings according to project language |
mmmm |
Displays the month as a full name (January-December) using the translated strings according to project language |
yy |
Displays the year as a two-digit number (00-99) |
yyyy |
Displays the year as a four-digit number (0000-9999) |
h |
Displays the hour without a leading zero (0-23) |
hh |
Displays the hour with a leading zero (00-23) |
n |
Displays the minute without a leading zero (0-59) |
nn |
Displays the minute with a leading zero (00-59) |
s |
Displays the second without a leading zero (0-59) |
ss |
Displays the second with a leading zero (00-59) |
z |
Displays the millisecond without a leading zero (0-999) |
zzz |
Displays the millisecond with a leading zero (000-999) |
t |
Displays the time using the format given by Windows' short time format |
tt |
Displays the time using the format given by Windows' long time format |
am/pm |
Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour before noon, and 'pm' for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly |
a/p |
Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour before noon, and 'p' for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly |
ampm |
Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the AM Symbol Windows setting for any hour before noon, and the contents of the PM Symbol Windows setting for any hour after noon |
/ |
Displays the date separator character given by Windows settings |
: |
Displays the time separator character given by Windows settings |
'xx'/"xx" |
Characters enclosed in single or double quotation marks are displayed as such, and do not affect formatting |
It is possible to reset to the default format for the project's current language by using the "Reset" button. Warning: this will discard any previously entered custom date / time format.