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>
|
---|
31 | properties in the current project. By default,
|
---|
32 | the <code>DSTAMP</code> property is in the
|
---|
33 | format "yyyyMMdd", <code>TSTAMP</code> is in the
|
---|
34 | format "hhmm", and <code>TODAY</code> is in the
|
---|
35 | format "MMMM dd yyyy". Use the nested <code><format></code> element
|
---|
36 | to specify a different format.</p>
|
---|
37 |
|
---|
38 | <p>These properties can be used in the build-file, for instance, to create
|
---|
39 | time-stamped filenames, or used to replace placeholder tags inside documents
|
---|
40 | to indicate, for example, the release date. The best place for this task is
|
---|
41 | probably 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>
|
---|
58 | The Tstamp task supports a <code><format></code> nested element that
|
---|
59 | allows a property to be set to the current date and time in a given format.
|
---|
60 | The 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.
|
---|
62 | The 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 "language, country, variant" 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 | <tstamp/>
|
---|
125 | </pre>
|
---|
126 |
|
---|
127 | <p>
|
---|
128 | sets the standard <code>DSTAMP</code>, <code>TSTAMP</code>,
|
---|
129 | and <code>TODAY</code> properties according to the default formats.</p>
|
---|
130 | <pre>
|
---|
131 | <tstamp>
|
---|
132 | <format property="TODAY_UK" pattern="d-MMMM-yyyy" locale="en,UK"/>
|
---|
133 | </tstamp>
|
---|
134 | </pre>
|
---|
135 | <p>
|
---|
136 | sets the standard properties as well as the property
|
---|
137 | <code>TODAY_UK</code> with the date/time pattern "d-MMMM-yyyy"
|
---|
138 | using English locale (eg. 21-May-2001).</p>
|
---|
139 |
|
---|
140 | <pre>
|
---|
141 | <tstamp>
|
---|
142 | <format property="touch.time" pattern="MM/dd/yyyy hh:mm aa"
|
---|
143 | offset="-5" unit="hour"/>
|
---|
144 | </tstamp>
|
---|
145 | </pre>
|
---|
146 | <p>
|
---|
147 | Creates a timestamp, in the property touch.time, 5 hours before the current time. The format in this example
|
---|
148 | is suitable for use with the <code><touch></code> task. The standard properties are set also.</p>
|
---|
149 |
|
---|
150 | <pre>
|
---|
151 | <tstamp prefix="start"/>
|
---|
152 | </pre>
|
---|
153 | <p>
|
---|
154 | Sets 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>
|
---|