zoukankan      html  css  js  c++  java
  • JAVA_build_ant_Tstamp

     

    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.

  • 相关阅读:
    LIGHTSWITCH 的树控件设计!
    企业即时通信平台与在线办公!
    特殊符号网 http://www.teshufuhao.net/
    国内主要工作流厂商分析 (转)
    衣联网 http://www.eelly.com/ 中国最大的专业服装批发市场(广州)
    NET FrameWork & CLR & C# 运行基本原理
    通过负载均衡器+域名实现容灾切换(2)DNS解析过程理解
    SPAN和RSPAN概念
    【转】一张图看懂开源许可协议,开源许可证GPL、BSD、MIT、Mozilla、Apache和LGPL的区别
    SIP Recording(录制)相关协议
  • 原文地址:https://www.cnblogs.com/liupuLearning/p/6133316.html
Copyright © 2011-2022 走看看