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