2001-02-13 12:32:01 +00:00
< html >
< head >
< meta http-equiv = "Content-Language" content = "en-us" >
2005-04-29 18:58:16 +00:00
< link rel = "stylesheet" type = "text/css" href = "../stylesheets/style.css" >
2002-02-03 22:00:42 +00:00
< title > TStamp Task< / title >
2001-02-13 12:32:01 +00:00
< / head >
< body >
< h2 > < a name = "tstamp" > Tstamp< / a > < / h2 >
2001-05-22 01:25:23 +00:00
2001-02-13 12:32:01 +00:00
< h3 > Description< / h3 >
2001-05-22 01:25:23 +00:00
< p > Sets the < code > DSTAMP< / code > , < code > TSTAMP< / code > , and < code > TODAY< / code >
2002-06-22 23:38:38 +00:00
properties in the current project. By default,
the < code > DSTAMP< / code > property is in the
2002-06-01 12:26:43 +00:00
format " yyyyMMdd" , < code > TSTAMP< / code > is in the
2001-05-22 01:25:23 +00:00
format " hhmm" , and < code > TODAY< / code > is in the
2004-11-19 09:07:12 +00:00
format " MMMM dd yyyy" . Use the nested < code > < format> < / code > element
2002-06-22 23:38:38 +00:00
to specify a different format.< / p >
2001-05-22 01:25:23 +00:00
< p > 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
2001-09-08 01:05:18 +00:00
probably in an initialization target.< / p >
2001-05-22 01:25:23 +00:00
2001-02-13 12:32:01 +00:00
< h3 > Parameters< / h3 >
< table border = "1" cellpadding = "2" cellspacing = "0" >
< tr >
< td valign = "top" > < b > Attribute< / b > < / td >
< td valign = "top" > < b > Description< / b > < / td >
< td align = "center" valign = "top" > < b > Required< / b > < / td >
< / tr >
2002-02-09 22:34:38 +00:00
< tr >
< td valign = "top" > prefix< / td >
< td valign = "top" > Prefix used for all properties set. The default is no prefix.< / td >
< td align = "center" valign = "top" > No< / td >
2001-02-13 12:32:01 +00:00
< / tr >
< / table >
< h3 > Nested Elements< / h3 >
2001-05-22 01:25:23 +00:00
The Tstamp task supports a < code > < format> < / code > nested element that
allows a property to be set to the current date and time in a given format.
2001-11-25 16:01:57 +00:00
The date/time patterns are as defined in the Java
2003-11-26 08:14:23 +00:00
< a href = "http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html" > SimpleDateFormat< / a > class.
2001-07-11 15:36:49 +00:00
The format element also allows offsets to be applied to the time to generate different time values.
< br > < br >
2001-02-13 12:32:01 +00:00
< table width = "60%" border = "1" cellpadding = "2" cellspacing = "0" >
< tr >
< td valign = "top" > < b > Attribute< / b > < / td >
< td valign = "top" > < b > Description< / b > < / td >
< td align = "center" valign = "top" > < b > Required< / b > < / td >
< / tr >
< tr >
< td valign = "top" > property< / td >
< td valign = "top" >
2001-05-22 01:25:23 +00:00
The property to receive the date/time string in the given pattern.
2001-02-13 12:32:01 +00:00
< / td >
< td align = "center" valign = "top" > Yes< / td >
< / tr >
< tr >
< td valign = "top" > pattern< / td >
2001-05-22 01:25:23 +00:00
< td valign = "top" > The date/time pattern to be used. The values are as defined by the Java SimpleDateFormat class.< / td >
2001-02-13 12:32:01 +00:00
< td align = "center" valign = "top" > Yes< / td >
< / tr >
2001-11-25 16:01:57 +00:00
< tr >
< td valign = "top" > timezone< / td >
< td valign = "top" > The timezone to use for displaying time. The values are as defined by the Java < a href = "http://java.sun.com/products/jdk/1.2/docs/api/java/util/TimeZone.html" > TimeZone< / a > class.< / td >
< td align = "center" valign = "top" > No< / td >
< / tr >
2001-07-11 15:36:49 +00:00
< tr >
< td valign = "top" > offset< / td >
< td valign = "top" > The numeric offset to the current time< / td >
< td align = "center" valign = "top" > No< / td >
< / tr >
< tr >
< td valign = "top" > unit< / td >
< td valign = "top" > The unit of the offset to be applied to the current time.
Valid Values are
< ul >
< li > millisecond< / li >
< li > second< / li >
< li > minute< / li >
< li > hour< / li >
< li > day< / li >
< li > week< / li >
< li > month< / li >
< li > year< / li >
< / ul >
< / td >
< td align = "center" valign = "top" > No< / td >
< / tr >
2001-08-01 11:22:18 +00:00
< tr >
< td valign = "top" > locale< / td >
< td valign = "top" > The locale used to create date/time string. The general
2001-08-30 13:23:14 +00:00
form is " language, country, variant" but either variant or variant and
2001-08-01 11:22:18 +00:00
country may be omitted. For more information please refer to documentation
2001-11-25 16:01:57 +00:00
for the
2001-08-01 11:22:18 +00:00
< a href = "http://java.sun.com/j2se/1.3/docs/api/java/util/Locale.html" > Locale< / a >
class.< / td >
< td align = "center" valign = "top" > No< / td >
< / tr >
2001-02-13 12:32:01 +00:00
< / table >
< h3 > Examples< / h3 >
2001-05-22 01:25:23 +00:00
< pre >
< tstamp/>
< / pre >
2001-02-13 12:32:01 +00:00
2001-05-22 01:25:23 +00:00
< p >
sets the standard < code > DSTAMP< / code > , < code > TSTAMP< / code > ,
and < code > TODAY< / code > properties according to the default formats.< / p >
< pre >
< tstamp>
2001-08-01 11:22:18 +00:00
< format property=" TODAY_UK" pattern=" d-MMMM-yyyy" locale=" en" />
2001-02-13 12:32:01 +00:00
< /tstamp>
< / pre >
2001-05-22 01:25:23 +00:00
< p >
sets the standard properties as well as the property
< code > TODAY_UK< / code > with the date/time pattern " d-MMMM-yyyy"
2001-09-08 01:05:18 +00:00
using English locale (eg. 21-May-2001).< / p >
2001-02-13 12:32:01 +00:00
2001-07-11 15:36:49 +00:00
< pre >
< tstamp>
2001-11-25 16:01:57 +00:00
< format property=" touch.time" pattern=" MM/dd/yyyy hh:mm aa"
2001-07-11 15:36:49 +00:00
offset=" -5" unit=" hour" />
2001-11-25 16:01:57 +00:00
< /tstamp>
< / pre >
2001-07-11 15:36:49 +00:00
< p >
Creates a timestamp, in the property touch.time, 5 hours before the current time. The format in this example
2004-11-19 09:07:12 +00:00
is suitable for use with the < code > < touch> < / code > task. The standard properties are set also.< / p >
2002-02-09 22:34:38 +00:00
< pre >
< tstamp prefix="start"/>
< / pre >
< p >
2002-06-22 23:38:38 +00:00
Sets three properties with the standard formats, prefixed with "start.":
2002-02-09 22:34:38 +00:00
< code > start.DSTAMP< / code > , < code > start.TSTAMP< / code > , and < code > start.TODAY< / code > .< / p >
2001-07-11 15:36:49 +00:00
2001-02-13 12:32:01 +00:00
< hr >
2005-03-07 18:09:10 +00:00
< p align = "center" > Copyright © 2000-2005 The Apache Software Foundation. All rights Reserved.< / p >
2001-02-13 12:32:01 +00:00
< / body >
< / html >