source: release-kits/lirk3/bin/ant-installer/web/manual1.6.2/manual/CoreTasks/tstamp.html@ 14982

Last change on this file since 14982 was 14982, checked in by oranfry, 16 years ago

initial import of LiRK3

File size: 5.1 KB
Line 
1<html>
2
3<head>
4<meta http-equiv="Content-Language" content="en-us">
5<title>TStamp Task</title>
6<link rel="stylesheet" type="text/css" href="../stylesheets/antmanual.css">
7</head>
8
9<body>
10
11<h2><a name="tstamp">Tstamp</a></h2>
12
13<h3>Description</h3>
14<p>Sets the <code>DSTAMP</code>, <code>TSTAMP</code>, and <code>TODAY</code>
15properties in the current project. By default,
16the <code>DSTAMP</code> property is in the
17format &quot;yyyyMMdd&quot;, <code>TSTAMP</code> is in the
18format &quot;hhmm&quot;, and <code>TODAY</code> is in the
19format &quot;MMMM dd yyyy&quot;. Use the nested &lt;format&gt; element
20to specify a different format.</p>
21
22<p>These properties can be used in the build-file, for instance, to create
23time-stamped filenames, or used to replace placeholder tags inside documents
24to indicate, for example, the release date. The best place for this task is
25probably in an initialization target.</p>
26
27<h3>Parameters</h3>
28<table border="1" cellpadding="2" cellspacing="0">
29 <tr>
30 <td valign="top"><b>Attribute</b></td>
31 <td valign="top"><b>Description</b></td>
32 <td align="center" valign="top"><b>Required</b></td>
33 </tr>
34 <tr>
35 <td valign="top">prefix</td>
36 <td valign="top">Prefix used for all properties set. The default is no prefix.</td>
37 <td align="center" valign="top">No</td>
38 </tr>
39</table>
40
41<h3>Nested Elements</h3>
42The Tstamp task supports a <code>&lt;format&gt;</code> nested element that
43allows a property to be set to the current date and time in a given format.
44The date/time patterns are as defined in the Java
45<a href="http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a> class.
46The format element also allows offsets to be applied to the time to generate different time values.
47<br><br>
48<table width="60%" border="1" cellpadding="2" cellspacing="0">
49 <tr>
50 <td valign="top"><b>Attribute</b></td>
51 <td valign="top"><b>Description</b></td>
52 <td align="center" valign="top"><b>Required</b></td>
53 </tr>
54 <tr>
55 <td valign="top">property</td>
56 <td valign="top">
57 The property to receive the date/time string in the given pattern.
58 </td>
59 <td align="center" valign="top">Yes</td>
60 </tr>
61 <tr>
62 <td valign="top">pattern</td>
63 <td valign="top">The date/time pattern to be used. The values are as defined by the Java SimpleDateFormat class.</td>
64 <td align="center" valign="top">Yes</td>
65 </tr>
66 <tr>
67 <td valign="top">timezone</td>
68 <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>
69 <td align="center" valign="top">No</td>
70 </tr>
71 <tr>
72 <td valign="top">offset</td>
73 <td valign="top">The numeric offset to the current time</td>
74 <td align="center" valign="top">No</td>
75 </tr>
76 <tr>
77 <td valign="top">unit</td>
78 <td valign="top">The unit of the offset to be applied to the current time.
79 Valid Values are
80 <ul>
81 <li>millisecond</li>
82 <li>second</li>
83 <li>minute</li>
84 <li>hour</li>
85 <li>day</li>
86 <li>week</li>
87 <li>month</li>
88 <li>year</li>
89 </ul>
90 </td>
91 <td align="center" valign="top">No</td>
92 </tr>
93 <tr>
94 <td valign="top">locale</td>
95 <td valign="top">The locale used to create date/time string. The general
96 form is &quot;language, country, variant&quot; but either variant or variant and
97 country may be omitted. For more information please refer to documentation
98 for the
99 <a href="http://java.sun.com/j2se/1.3/docs/api/java/util/Locale.html">Locale</a>
100 class.</td>
101 <td align="center" valign="top">No</td>
102 </tr>
103</table>
104
105<h3>Examples</h3>
106
107<pre>
108 &lt;tstamp/&gt;
109</pre>
110
111<p>
112sets the standard <code>DSTAMP</code>, <code>TSTAMP</code>,
113and <code>TODAY</code> properties according to the default formats.</p>
114<pre>
115 &lt;tstamp&gt;
116 &lt;format property=&quot;TODAY_UK&quot; pattern=&quot;d-MMMM-yyyy&quot; locale=&quot;en&quot;/&gt;
117 &lt;/tstamp&gt;
118</pre>
119<p>
120sets the standard properties as well as the property
121<code>TODAY_UK</code> with the date/time pattern &quot;d-MMMM-yyyy&quot;
122using English locale (eg. 21-May-2001).</p>
123
124<pre>
125 &lt;tstamp&gt;
126 &lt;format property=&quot;touch.time&quot; pattern=&quot;MM/dd/yyyy hh:mm aa&quot;
127 offset=&quot;-5&quot; unit=&quot;hour&quot;/&gt;
128 &lt;/tstamp&gt;
129</pre>
130<p>
131Creates a timestamp, in the property touch.time, 5 hours before the current time. The format in this example
132is suitable for use with the &lt;touch&gt; task. The standard properties are set also.</p>
133
134<pre>
135 &lt;tstamp prefix="start"/&gt;
136</pre>
137<p>
138Sets three properties with the standard formats, prefixed with "start.":
139<code>start.DSTAMP</code>, <code>start.TSTAMP</code>, and <code>start.TODAY</code>.</p>
140
141
142<hr>
143<p align="center">Copyright &copy; 2000-2004 The Apache Software Foundation. All rights Reserved.</p>
144
145</body>
146</html>
Note: See TracBrowser for help on using the repository browser.