Ant: Want to have a property that has a timestamp in it
I'm using Ant 1.8.2 on Ubuntu Linux (and also on Windows 7 running Cygwin). I have this property ...
<property name="results" location="${selenium.results.dir}/Results-20110922_131005.html" />
I would like to replace t开发者_StackOverflow社区he "20110922_131005" with something less hard coded that represents the current time stamp. How can I do this?
<tstamp>
<format property="time.stamp" pattern="yyyy-MM-dd_HH:mm:ss"/>
</tstamp>
This will create a property called ${time.stamp}
.
<property name="results"
location="${selenium.results.dir}/Results-${time.stamp}.html" />
you can use tstamp in ant. Also look at SO Question : output timestamp in ant
精彩评论