<tstamp>

[This is preliminary documentation and subject to change.]

Sets properties with the current date and time.

By default the <tstamp> task displays the current date and time and sets the following properties:

To set an additional property with a custom date/time use the property and pattern attributes. To set a number of additional properties with the exact same date and time use the formatter nested element (see example).

The date and time string displayed by the <tstamp> task uses the computer's default long date and time string format. You might consider setting these to the ISO 8601 standard for date and time notation.

Parameters

Attribute Type Description Required
pattern string The date/time pattern to be used. False
property string The property to receive the date/time string in the given pattern. False
failonerror bool Determines if task failure stops the build, or is just reported. The default is true. False
if bool If true then the task will be executed; otherwise, skipped. The default is true. False
unless bool Opposite of if. If false then the task will be executed; otherwise, skipped. The default is false. False
verbose bool Determines whether the task should report detailed build log messages. The default is false. False

Nested Elements:

<formatter>

Parameters

Attribute Type Description Required
pattern string The string pattern to use to format the property. True
property string The name of the NAnt property to set. True
if bool Indicates if the formatter should be used to format the timestamp. If true then the formatter will be used; otherwise, skipped. The default is true. False
unless bool Indicates if the formatter should be not used to format the timestamp. If false then the formatter will be used; otherwise, skipped. The default is false. False

</formatter>

Examples

Requirements

Assembly: NAnt.Core (0.92.4509.0)