Contents Previous Next

%%date

The %%date macro expands to the current date and time. It is very useful on the document headers or footer, to register the date when the document was generated. To expand to the source document last modification time, see the %%mtime macro .

This macros accepts several formatting directives. The full list can be found in the Python site. Here are the most commonly used:

DirectiveDescription
%aLocale's abbreviated weekday name.
%ALocale's full weekday name.
%bLocale's abbreviated month name.
%BLocale's full month name.
%cLocale's appropriate date and time representation.
%dDay of the month as a decimal number [01,31].
%HHour (24-hour clock) as a decimal number [00,23].
%IHour (12-hour clock) as a decimal number [01,12].
%mMonth as a decimal number [01,12].
%MMinute as a decimal number [00,59].
%pLocale's equivalent of either AM or PM.
%SSecond as a decimal number [00,61]. (1)
%xLocale's appropriate date representation.
%XLocale's appropriate time representation.
%yYear without century as a decimal number [00,99].
%YYear with century as a decimal number.
%%A literal "%" character.

Examples:

Macro-->Results for on 2008, Jul 26 at 16:36
%%date(Converted on: %c)--> Converted on: Sat Jul 26 16:36:06 2008
%%date(%Y-%m-%d)-->2008-07-26
%%date(%I:%M %p)-->04:36 PM
%%date(Today is %A, on %B.)--> Today is Saturday, on July.

Contents Previous Next