You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

tstamp.html 2.6 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Ant User Manual</title>
  5. </head>
  6. <body>
  7. <h2><a name="tstamp">Tstamp</a></h2>
  8. <h3>Description</h3>
  9. <p>Sets the <code>DSTAMP</code>, <code>TSTAMP</code>, and <code>TODAY</code>
  10. properties in the current project. The <code>DSTAMP</code> property is in the
  11. format &quot;yyyymmdd&quot;, <code>TSTAMP</code> is in the
  12. format &quot;hhmm&quot;, and <code>TODAY</code> is in the
  13. format &quot;month day year&quot;.
  14. <p>These properties can be used in the build-file, for instance, to create
  15. time-stamped filenames, or used to replace placeholder tags inside documents
  16. to indicate, for example, the release date. The best place for this task is
  17. probably in an initialization target.
  18. <h3>Parameters</h3>
  19. <table border="1" cellpadding="2" cellspacing="0">
  20. <tr>
  21. <td valign="top"><b>Attribute</b></td>
  22. <td valign="top"><b>Description</b></td>
  23. <td align="center" valign="top"><b>Required</b></td>
  24. </tr>
  25. <tr> <td colspan="3"> No parameters</td>
  26. </tr>
  27. </table>
  28. <h3>Nested Elements</h3>
  29. The Tstamp task supports a <code>&lt;format&gt;</code> nested element that
  30. allows a property to be set to the current date and time in a given format.
  31. The date/time patterns are as defined in the Java
  32. <a href=http://java.sun.com/products/jdk/1.2/docs/api/java/text/SimpleDateFormat.html>SimpleDateFormat</a> class.
  33. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  34. <tr>
  35. <td valign="top"><b>Attribute</b></td>
  36. <td valign="top"><b>Description</b></td>
  37. <td align="center" valign="top"><b>Required</b></td>
  38. </tr>
  39. <tr>
  40. <td valign="top">property</td>
  41. <td valign="top">
  42. The property to receive the date/time string in the given pattern.
  43. </td>
  44. <td align="center" valign="top">Yes</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">pattern</td>
  48. <td valign="top">The date/time pattern to be used. The values are as defined by the Java SimpleDateFormat class.</td>
  49. <td align="center" valign="top">Yes</td>
  50. </tr>
  51. </table>
  52. <h3>Examples</h3>
  53. <pre>
  54. &lt;tstamp/&gt;
  55. </pre>
  56. <p>
  57. sets the standard <code>DSTAMP</code>, <code>TSTAMP</code>,
  58. and <code>TODAY</code> properties according to the default formats.</p>
  59. <pre>
  60. &lt;tstamp&gt;
  61. &lt;format property=&quot;TODAY_UK&quot; pattern=&quot;d-MMMM-yyyy&quot;/&gt;
  62. &lt;/tstamp&gt;
  63. </pre>
  64. <p>
  65. sets the standard properties as well as the property
  66. <code>TODAY_UK</code> with the date/time pattern &quot;d-MMMM-yyyy&quot;
  67. (eg., 21-May-2001).
  68. <hr>
  69. <p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights Reserved.</p>
  70. </body>
  71. </html>