how to set time property in ant
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?
You use the TStamp task.
<tstamp>
<format property="TODAY"
pattern="yyyyMMddhhmm"/>
</tstamp>
You can use the TStamp task
for example :
<tstamp>
<format property="propertyName" pattern="yyyyMMddhhmm" />
</tstamp>
found a solution:
<target name="timestamp2">
<tstamp>
<format property="current.time" pattern="yyyyMMd_hhmmss" />
</tstamp>
<echo message="current time: ${current.time}" />
</target>
精彩评论