Oddjob's inbuilt conversion allows a date to be specified as text in any of these formats:
Because of this a date property of a job can be specified perfectly easily as a value or a property. However there are two situations when this is inadequate:
In either or both of these cases the date type can be used.
This date type can also be used to specify a java Calendar property which Oddjob's inbuilt conversion will currently not do from text.
| date | A date in text, if a format is specified it is expected to be in the format provide, otherwise it is expected to be in the default format.. |
| format | The format the date is in. |
| timeZone | The time zone the date is for. |
| Example 1 | A simple example of specifying a date. |
| Example 2 | Specifying a date in a different format. |
| Example 3 | Adjusting a date by Time Zone. |
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | Yes. |
A date in text, if a format is specified it is expected to be in the format provide, otherwise it is expected to be in the default format..
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. |
The format the date is in.
| Configured By | ATTRIBUTE |
| Access | READ_WRITE |
| Required | No. |
The time zone the date is for.
A simple example of specifying a date.
<date date="2009-12-25 12:30"/>
Specifying a date in a different format.
<date date="25/12/2009 12:30" format="dd/MM/yyyy HH:mm"/>
Adjusting a date by Time Zone.
<sequential>
<jobs>
<variables id="vars">
<xmas>
<date timeZone="US/Hawaii" date="2009-12-25"/>
</xmas>
</variables>
<echo>Christmas in Hawaii starts at ${vars.xmas}.</echo>
</jobs>
</sequential>