B.49 TstampTask

Sets the DSTAMP, TSTAMP, and TODAY properties in the current project. By default, the DSTAMP property is in the format "%Y%m%d", TSTAMP is in the format "%H%M", and TODAY is in the format "%B %d %Y". Use the nested <format> element to specify a different format.

These properties can be used in the build-file, for instance, to create time-stamped filenames, or used to replace placeholder tags inside documents to indicate, for example, the release date. The best place for this task is probably in an initialization target.

Table B.51: Attributes

NameTypeDescriptionDefaultRequired
prefixStringPrefix used for all properties set.n/aNo

B.49.1 Examples

<tstamp/>

sets the standard DSTAMP, TSTAMP, and TODAY properties according to the default formats.

<tstamp>
  <format property="DATE" pattern="%c" locale="nl_NL"/>
</tstamp>

sets the standard properties as well as the property DATE with the date/time pattern "%c" using the Dutch locale.

<tstamp prefix="start"/>

sets three properties with the standard formats, prefixed with "start.": start.DSTAMP, start.TSTAMP, and start.TODAY.

B.49.2 Supported Nested Tags

  • format

    The Tstamp task supports a <format> nested element that allows a property to be set to the current date and time in a given format. The date/time patterns are as defined in the PHP strftime() function.

Table B.52: Attributes

NameTypeDescriptionDefaultRequired
propertyStringThe property to receive the date/time string in the given pattern.n/aYes
patternStringThe date/time pattern to be used. The values are as defined by the PHP strftime() function.n/aYes
localeStringThe locale used to create date/time string. For more information see the PHP setlocale() function.n/aNo
timezoneStringThe timezone to use for displaying time.n/aNo