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. 2014-08-01 ASP.NET中对SQLite数据库的操作——ADO.NET

    今天是在吾索实习的第18天.我主要学习了如何在ASP.NET中对SQLite数据库的操作,其基本操作如下: 添加引用System.Data.SQLite.dll(PS:在网页里面任意找到适合的.NET ...

  2. Android UI 之TextView控件属性列表

    在网上收集到了TextView 的属性,在开发过程中还是挺有用的. android:autoLink 设置是否当文本为URL链接/email/电话号码/map时,文本显示为可点击的链接.可选值(non ...

  3. java中protect属性用法总结

    测试代码: pojo类: package com.lky.h1; public class Base { private Integer id; protected String name; publ ...

  4. jQuery的基本语法

    index.html代码 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...

  5. Mongodb 条件查询

    1.1 查询出所有数据的指定键(name ,age ,country) db.persons.find({},{name:1,age:1,country:1,_id:0}) 2.查询条件 2.查询条件 ...

  6. Java中的Switch用法

    一.java当中的switch与C#相比有以下区别 注:在java中switch后的表达式的类型只能为以下几种:byte.short.char.int(在Java1.6中是这样),   在java1. ...

  7. C#Transfrom

    代码如下: private void btnConvertType_Click(object sender, EventArgs e) { if (rdo_btn_ConvertObject.Chec ...

  8. ViutualBox虚拟机里添加磁盘

    1.首先在VirtualBox界面给虚拟机添加一块磁盘 2. 启动系统,查看当前磁盘空间 Last login: Tue Mar 15 22:24:47 2016 from 192.168.1.100 ...

  9. C#。总结

    数据类型--变量与常量--运算符与表达式--语句(if,for)--数组--函数--结构体一.数据类型: (一)内建类型 整型(int short long byte uint ushort ulon ...

  10. javascript sort 用法

    <html> <head> <title></title> <script type="text/javascript" sr ...