Please enable JavaScript to view this site.

 

flag_green        Key Information

You can only format the date and time with these four variables that support formatting strings..

 

Help+Manual supports a number of variables for inserting the date and/or time. Some of these support special formatting strings with which you have full control over how the date and time elements are displayed.

Language of the date and time entries

The date and time entries created by these variables will use the language setting of your Help+Manual project.

Languages with nominative or genitive date forms

Variables that include time can only write the month names in the nominative form for these languages, because that is all that Windows allows in combination with the time. If you need the genitive form use <%DATELONG%> or <%DATE%>, which both write the genitive form, and combine them with a separate time variable. The variables <%NOW%> and <%TOPICLASTEDITED%> both write the nominative form, because they also include the time.

All date and time variables

The variables shown in red also support formatting strings (see further below for details).

<%NOW%>:

Inserts the current date and time. Returns the month in nominative form in applicable languages. Supports a formatting string (see further below for details).

<%DATE%>:

The current date in short format, without the time. Returns the month in genitive form in applicable languages. Supports a formatting string (see further below for details).

<%\DATELONG%>:

The current date in long format, without the time. This also includes long month names, in the genitive form in applicable languages.

<%TIME%>:

The current time in short format.

<%TIMELONG%>:

The current time in long format.

<%MONTHNAME%>:

The current month in long format (i.e. February, not Feb or 2).

<%YEAR%>:

The current year in 4-digit format.

<%TOPICLASTEDITED%>:

The date and time when the topic containing the variable was last edited in short format. Supports a formatting string (see further below for details). Uses the nominative form for applicable languages.

<%TOPICLASTEDITEDTIME%>:

The time when the topic containing the variable was last edited.

How to use formatting strings in the supported variables

To use this feature you insert the <%NOW%> , <%DATE%> or <%TOPICLASTEDITED%> variable in your project, either manually or with the Insert Variable tool, and then manually type a format string in parentheses inside the variable name in the Help+Manual editor:

<%NOW(format string)%>
<%DATE(format string)%>
<%TOPICLASTEDITED(format string)%>

Position and syntax of the format string:

The format string must be inserted in parentheses between last letter of the variable name and the closing %> characters of the variable tag. The string can contain both "specifiers" that define the date and time format and normal text. Normal text must be enclosed in double quotes.

Specifiers may be written in upper or lower case, the result will be the same.

Examples:

<%NOW("This topic was published on " dddd, mmmm d, yyyy, " at " hh:mm AM/PM)%>
<%TOPICLASTEDITED("This topic was last modified on " dddd, mmmm d, yyyy, " at " hh:mm AM/PM)%>

Example result: This topic was last modified on Tuesday, January 3, 2013, at 12:22 PM

The text within the quotes will be inserted exactly as it is written. Any spaces required must be included within the quotes and the quotes must be separated from the specifiers by spaces.

Date and time format specifiers

Specifier

Function

" text "

' text '

Anything enclosed in single or double quotes is inserted unchanged as plain text and does not affect formatting.

. and ,

You can include periods and commas in the formatting string with the specifiers, these characters to not need to be quoted.

c

Displays the date using the standard Windows short date format, followed by the time using the standard Windows long time format. The time is not displayed if the fractional part of the DateTime value is zero.

d

Displays the day of the month as a number without a leading zero (1-31).

dd

Displays the day of the month as a number with a leading zero (01-31).

ddd

Displays the day as an abbreviation (Sun-Sat) using the standard Windows strings for short day names.

dddd

Displays the day as a full name (Sunday-Saturday) using the standard Windows strings for full day names.

ddddd

Displays the date using the standard Windows short date format.

dddddd

Displays the date using the standard Windows long date format.

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 standard Windows values for short month names.

mmmm

Displays the month as a full name (January-December) using the standard Windows values for long month names.

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 standard Windows short time format.

tt

Displays the time using the standard 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.

ampm

Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the Windows TimeAMString global variable for any hour before noon, and the contents of the TimePMString global variable for any hour after noon.

/

Displays the date separator set in your Windows configuration.

:

Displays the time separator set in your Windows configuration.

See also:

Using Variables