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. ural 1052 Rabbit Hunt

    http://acm.timus.ru/problem.aspx?space=1&num=1052 #include <cstdio> #include <cstring&g ...

  2. Activity大致会经过如下四个状态

    1.活动主题:当前Activity位于前台,用户可见,可以获得焦点.2.暂停状态:其他Activity位于前台,该Activity依然可见,只是不能获得焦点.3.停止状态:该Activity不可见,失 ...

  3. 淺析LED、LED背光、OLED的技術原理與區別

    眼下很多廠商在推廣自己產品的時候都偷換了概念.明明是LED背光顯示器卻要簡稱為LED顯示器.事實上LED顯示器和目前的LED背光顯示器有著本質的區別.當然容易讓大家混淆的還有個技術非常先進的OLED. ...

  4. JavaScript 中的非真值

    False values 下面这些值将被计算出 false (also known as Falsy values): false undefined null 0 NaN 空字符串 ("& ...

  5. Java实现SOAP协议 之 HelloWorld

    Java实现SOAP协议 之 HelloWorld SOAP是把基于HTTP的WEB技术与XML的灵活性和可扩展性组合在了一起. 准备: 1. 准备一个web server.Tomcat 下载地址 h ...

  6. hdu 1860 统计字符

    Problem Description 统计一个给定字符串中指定的字符出现的次数 Input 测试输入包含若干测试用例,每个测试用例包含2行,第1行为一个长度不超过5的字符串,第2行为一个长度不超过8 ...

  7. Bozo排序

    Bogo的变种,继续卖萌... Bogo每次都随机打乱数组,而Bozo每次随机选择两个位置,然后交换这两个位置的值.相同的是不断靠概率不断查看有序了没... public static void bo ...

  8. openstack neutron debugs lists

  9. Android实现图片放大缩小

    package com.min.Test_Gallery; import android.app.Activity; import android.graphics.Bitmap; import an ...

  10. mysql中DES加密解密

      DES_DECRYPT(crypt_str[,key_str]) 使用DES_ENCRYPT()加密一个字符串.若出现错误,这个函数会返回 NULL. 注意,这个函数只有当MySQL在SSL 的支 ...