I want to have a property with the current time in a specific format: yyyyMMddhhmm . how can I do that in java ant build.xml?
+3
A:
You can use the TStamp task
for example :
<tstamp>
<format property="propertyName" pattern="yyyyMMddhhmm" />
</tstamp>
Colin Hebert
2010-10-10 08:09:45
+4
A:
You use the TStamp task.
<tstamp>
<format property="TODAY"
pattern="yyyyMMddhhmm"/>
</tstamp>
Banang
2010-10-10 08:12:23
+1
A:
found a solution:
<target name="timestamp2">
<tstamp>
<format property="current.time" pattern="yyyyMMd_hhmmss" />
</tstamp>
<echo message="current time: ${current.time}" />
</target>
ohadshai
2010-10-10 08:22:09