🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# B.48 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.49:聽Attributes NameTypeDescriptionDefaultRequired`prefix``String`Prefix used for all properties set.n/aNo B.48.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.48.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.50:聽Attributes NameTypeDescriptionDefaultRequired`property``String`The property to receive the date/time string in the given pattern.n/aYes`pattern``String`The date/time pattern to be used. The values are as defined by the PHP strftime() function.n/aYes`locale``String`The locale used to create date/time string. For more information see the PHP setlocale() function.n/aNo`timezone``String`The timezone to use for displaying time.n/aNo