B.35 TstampTask
Prev | Appendix B. Core tasks | Next

## B.35 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.37: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`prefix` | `String` | Prefix used for all properties set. | n/a | No

### B.35.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.35.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.38: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`property` | `String` | The property to receive the date/time string in the given pattern. | n/a | Yes
`pattern` | `String` | The date/time pattern to be used. The values are as defined by the PHP strftime() function. | n/a | Yes
`locale` | `String` | The locale used to create date/time string. For more information see the PHP setlocale() function. | n/a | No

Prev | Up | Next
B.34 TryCatchTask | Home | B.36 TypedefTask