DateTime Extension

The DateTime extension provides the "datetime" command that provides a mechanism for date and time operations. This extension is based on the datetime package that is part of the standard python library.

Table 1: Configuration items for the datetime extension.

KeyDefaultDescription
activeTrueToggle for disabling the extension. This only changes the initial active state, use setActive to control at runtime.

Today

The "today" sub-command inserts the date when the execution of the documentation build occurs, by calling the python datetime.date.today() function, as demonstrated in Example 1. The available settings for the this command are provided in Table 2.

Table 2: Available settings for the !datetime today command.

KeyDefaultDescription
styleNoneThe style settings that are passed to rendered HTML tag.
classNoneThe class settings to be passed to rendered HTML tag.
idNoneThe class settings to be passed to the rendered tag.
format%Y-%m-%dThe date format (see python datetime).

Example 1: Example of showing date of build execution.

!datetime today

!datetime today format=%B %d, %Y

Today is [!datetime!today] or in a nicer format: [!datetime!today format=%B %d, %Y].