Runtime content

The following commands generate and insert content on a page.

The <date/> command

Generate the current date and/or time. The command format is:

<date var="VARNAME" type="TYPE" format="FORMAT" /> 

If the var argument specifies a user variable name the formatted date is assigned to that variable.

If no var argument is present the date is rendered on the page. See “Deferred content commands” for restrictions that apply in this case.

If the date TYPE is... then the output FORMAT is..
short Pre-defined, and of the form 07/16/03 (this is the default)
medium Pre-defined, and of the form 16 July 2003
long Pre-defined, and of the form Wednesday 16 July 2003, (02:04PM)
user User defined (see table below)

The format attribute declares the format string for a date of type user. It is ignored for other type values. The format string consists of zero or more formatting codes and ASCII printable characters. All other characters are copied unchanged to the input stream. References to unknown format codes are reported as a non-fatal warning.

Each format code is replaced by a character string as described by the following table:

Code Meaning
%a abbreviated weekday name
%A full weekday name
%b abbreviated month name
%B full month name
%c date and time representation appropriate for locale
%d day of month as a decimal number (01–31)
%H hour (00–23)
%I hour (01–12)
%j day number of year (001–366)
%m month number (01–12)
%M minute (00–59)
%p current locale's AM or PM indicator for 12 hour clock
%S seconds (00–59)
%U week number of year (00–53), Sunday is the first day of week 1
%w weekday number (0–6), Sunday = 0
%W week number of year (00–53), Monday is the first day of week 1
%x date representation for current locale
%X time representation for current locale
%y year without century (00–99)
%Y year with century (for example, 2009)
%Z the time-zone name or abbreviation
%% percent sign

Other format codes may be available on specific platforms; the list above will work on all platforms.

The <telltale/> command

Insert a data telltale within a fixed block. See “Data telltales”.

See “Deferred content commands” for restrictions that apply to the use of this command.

To assign the telltale value to a user variable use the <set> command.

The <topleaf-version/> command

Insert a string that identifies the version of TopLeaf that created the page.

See “Deferred content commands” for restrictions that apply to the use of this command.