TStampTask.

Pattern Property

Summary

The date/time pattern to be used.
Assembly
NAnt.Core.dll
Namespace
NAnt.Core.Tasks
Containing Type
TStampTask

Syntax

[TaskAttribute("pattern", Required = false)]
public string Pattern { get; set; }

Remarks

The following table lists the standard format characters for each standard pattern. The format characters are case-sensitive; for example, 'g' and 'G' represent slightly different patterns.

Format CharacterDescription Example Format Pattern (en-US)dMM/dd/yyyyDdddd, dd MMMM yyyyfdddd, dd MMMM yyyy HH:mmFdddd, dd MMMM yyyy HH:mm:ssgMM/dd/yyyy HH:mmGMM/dd/yyyy HH:mm:ssm, MMMMM ddr, Rddd, dd MMM yyyy HH':'mm':'ss 'GMT'syyyy'-'MM'-'dd'T'HH':'mm':'sstHH:mmTHH:mm:ssuyyyy'-'MM'-'dd HH':'mm':'ss'Z'Udddd, dd MMMM yyyy HH:mm:ssy, Yyyyy MMMM

The following table lists the patterns that can be combined to construct custom patterns. The patterns are case-sensitive; for example, "MM" is recognized, but "mm" is not. If the custom pattern contains white-space characters or characters enclosed in single quotation marks, the output string will also contain those characters. Characters not defined as part of a format pattern or as format characters are reproduced literally.

FormatPattern DescriptiondThe day of the month. Single-digit days will not have a leading zero.ddThe day of the month. Single-digit days will have a leading zero.dddThe abbreviated name of the day of the week.ddddThe full name of the day of the week.MThe numeric month. Single-digit months will not have a leading zero.MMThe numeric month. Single-digit months will have a leading zero.MMMThe abbreviated name of the month.MMMMThe full name of the month.yThe year without the century. If the year without the century is less than 10, the year is displayed with no leading zero.yyThe year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.yyyyThe year in four digits, including the century.ggThe period or era. This pattern is ignored if the date to be formatted does not have an associated period or era string.hThe hour in a 12-hour clock. Single-digit hours will not have a leading zero.hhThe hour in a 12-hour clock. Single-digit hours will have a leading zero.HThe hour in a 24-hour clock. Single-digit hours will not have a leading zero.HHThe hour in a 24-hour clock. Single-digit hours will have a leading zero.mThe minute. Single-digit minutes will not have a leading zero.mmThe minute. Single-digit minutes will have a leading zero.sThe second. Single-digit seconds will not have a leading zero.ssThe second. Single-digit seconds will have a leading zero.fThe fraction of a second in single-digit precision. The remaining digits are truncated.ffThe fraction of a second in double-digit precision. The remaining digits are truncated.fffThe fraction of a second in three-digit precision. The remaining digits are truncated.ffffThe fraction of a second in four-digit precision. The remaining digits are truncated.fffffThe fraction of a second in five-digit precision. The remaining digits are truncated. ffffffThe fraction of a second in six-digit precision. The remaining digits are truncated. fffffffThe fraction of a second in seven-digit precision. The remaining digits are truncated. tThe first character in the AM/PM designator.ttThe AM/PM designator. zThe time zone offset ("+" or "-" followed by the hour only). Single-digit hours will not have a leading zero. For example, Pacific Standard Time is "-8".zzThe time zone offset ("+" or "-" followed by the hour only). Single-digit hours will have a leading zero. For example, Pacific Standard Time is "-08".zzzThe full time zone offset ("+" or "-" followed by the hour and minutes). Single-digit hours and minutes will have leading zeros. For example, Pacific Standard Time is "-08:00".:The default time separator./The default date separator.\ cPattern Where c is any character. Displays the character literally. To display the backslash character, use "\\".

Attributes

Type Description
TaskAttributeAttribute Indicates that property should be treated as a XML attribute for the task.

Value

Type Description
string