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. 【转】Java中 List的遍历

    原文网址:http://blog.csdn.net/player26/article/details/3955906 import java.util.ArrayList; import java.u ...

  2. 将汉字转为UTF-8编码

    01./** 02. * 将文件名中的汉字转为UTF8编码的串,以便下载时能正确显示另存的文件名. 03. * @param s 原文件名 04. * @return 重新编码后的文件名 05. */ ...

  3. RenderBody, RenderPage and RenderSection methods in MVC 3

    原文地址:http://www.codeproject.com/Articles/383145/RenderBody-RenderPage-and-RenderSection-methods-in R ...

  4. HDU_2034——集合A-B

    Problem Description 参加过上个月月赛的同学一定还记得其中的一个最简单的题目,就是{A}+{B},那个题目求的是两个集合的并集,今天我们这个A-B求的是两个集合的差,就是做集合的减法 ...

  5. GF(2^8)乘法优化

    利用指数表和对数表,实现GF(2^8)的乘法优化. 首先利用简单的基础的GF(2^8)乘法,构造指数表和对数表.在这里选取生成元3. 指数表exp[i] = 3^i,对数表log[i] = log3( ...

  6. 远程连接mysql

    win系统下,连接别人的mysql或者让别人链接自己的mysql: 打开命令行cmd 进入mysql: mysql -u root -p mysql>use mysql;  mysql>s ...

  7. Spring容器的工具类

    代码实现: package com.ht.util; import java.util.Map; import org.springframework.beans.BeansException; im ...

  8. thinkphp+datatables+ajax 大量数据服务器端查询

    今天一白天全耗在这个问题上了,知乎2小时除外... 现在19:28分,记下来以备后查. 问题描述:从后台数据库查询人员信息,1w多条,使用一个好看的基于bootstrap的模板 Bootstrap-A ...

  9. Java[3] Java多线程相关资料

    Java多线程: http://www.uml.org.cn/j2ee/201509093.asp

  10. zookeeper[4] 安装windows zookeeper,及问题处理

    安装步骤: 1.在如下路径下载zookeeper-3.4.7.tar.gz http://mirrors.cnnic.cn/apache/zookeeper/stable/ 2.解压zookeeper ...