Description

Sets the DSTAMPTSTAMP, and TODAY properties in the current project. By default, the DSTAMP property is in the format "yyyyMMdd", TSTAMP is in the format "hhmm", and TODAY is in the format "MMMM dd yyyy". 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.

Parameters

Attribute Description Required
prefix Prefix used for all properties set. The default is no prefix. No

Nested Elements

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 Java SimpleDateFormat class. The format element also allows offsets to be applied to the time to generate different time values.

Attribute Description Required
property The property to receive the date/time string in the given pattern. Yes
pattern The date/time pattern to be used. The values are as defined by the Java SimpleDateFormat class. Yes
timezone The timezone to use for displaying time. The values are as defined by the Java TimeZone class. No
offset The numeric offset to the current time No
unit The unit of the offset to be applied to the current time. Valid Values are

  • millisecond
  • second
  • minute
  • hour
  • day
  • week
  • month
  • year
No
locale The locale used to create date/time string. The general form is "language, country, variant" but either variant or variant and country may be omitted. For more information please refer to documentation for the Locale class. No

Examples

  <tstamp/>

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

  <tstamp>
<format property="TODAY_GB" pattern="d-MMMM-yyyy" locale="en,GB"/>
</tstamp>

sets the standard properties as well as the property TODAY_UK with the date/time pattern "d-MMMM-yyyy" using English locale (eg. 21-May-2001).

  <tstamp>
<format property="touch.time" pattern="MM/dd/yyyy hh:mm aa"
offset="-5" unit="hour"/>
</tstamp>

Creates a timestamp, in the property touch.time, 5 hours before the current time. The format in this example is suitable for use with the <touch> task. The standard properties are set also.

  <tstamp prefix="start"/>

Sets three properties with the standard formats, prefixed with "start.": start.DSTAMPstart.TSTAMP, and start.TODAY.

JAVA_build_ant_Tstamp的更多相关文章

随机推荐

  1. vector,list和deque区别

    stl提供了三个最基本的容器:vector,list,deque. vector和built-in数组类似,它拥有一段连续的内存空间,并且起始地址不变,因此它能非常好的支持随即存取,即[]操作符,但由 ...

  2. FILTER的执行次数和驱动表问题

    drop table test1; create table test1 as select * from dba_objects where rownum<1000; drop table t ...

  3. 通过JS触发TextBox的ontextchanged事件,并获取TextBox所在GridView的那一行

    protected void txtInsNum_TextChanged(object sender, EventArgs e) { TextBox t = (TextBox)sender; Grid ...

  4. strcpy完整版 与 strcpy为什么有返回值

    一个标准的strcpy函数: 原本以为自己对strcpy还算比较了解,结果面试时还是悲剧了. 下面给出网上strcpy的得分版本: 2分 void strcpy( char *strDest, cha ...

  5. Acdream1157---Segments (CDQ分治)

    陈丹琦分治~~~其实一些数据小的时候可以用二维或者多维树状数组做的,而数据大的时候就无力的题目,都可以用陈丹琦分治解决. 题目:由3钟类型操作:1)D L R(1 <= L <= R &l ...

  6. [LeetCode] Maximum Gap 解题思路

    Given an unsorted array, find the maximum difference between the successive elements in its sorted f ...

  7. linux0.12 学习总序(不断更新状态中)

    最近有空闲时间,想静下心来学点东西.一直对kernel有兴趣,又苦于无从下手,就拿linux0.12练手.尝试了解并熟悉kernel各模块工作原理. 接下来的博客主要用来记录自己所遇到的问题和解决的方 ...

  8. 深入理解linux网络技术内幕读书笔记(三)--用户空间与内核的接口

    Table of Contents 1 概论 1.1 procfs (/proc 文件系统) 1.1.1 编程接口 1.2 sysctl (/proc/sys目录) 1.2.1 编程接口 1.3 sy ...

  9. UVA 714 Copying Books 最大值最小化问题 (贪心 + 二分)

      Copying Books  Before the invention of book-printing, it was very hard to make a copy of a book. A ...

  10. Java调用天气Webservice的小应用

    废话不多说,直接贴代码: CityReq.java package com.weather; import javax.xml.bind.annotation.XmlElement; import j ...