aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes quick question about TStamp in ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "quick question about TStamp in ant" Watch "quick question about TStamp in ant" New topic
Author

quick question about TStamp in ant

kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
I know that time and date properties can be set using <tstamp/>, but how do you output or echo this value? For example, as a variable in a message or log statement
[ September 22, 2006: Message edited by: kwame Iwegbue ]

Who dares, wins! (SAS motto)
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
What have you tried? What isn't working or what kind of output are you getting?

It is setting properties that you can use like any other property.
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197


but <tstamp/> not supported in <echo>

I've looked in the Ant manual, but I couldn't see any reference to outputing time.
prateek urmaliya
Ranch Hand

Joined: Sep 15, 2006
Posts: 87
Hi Kwame,

<project default="decko" name="bar-bar-decko" basedir=".">
<tstamp>
<format property="touch.time" pattern="MM_dd_yyyy_hh_mm_aa"/>
</tstamp>
<target name="decko">
<echo>Twas brillig, and the slithy toves</echo>
<echo>touch.time=${touch.time}</echo>
</target>
</project>

you can set the pattern.

HTH


this message brought to you by .... PIE! .... it's yummy! ;)
kwame Iwegbue
Ranch Hand

Joined: Sep 02, 2000
Posts: 197
Thank you Prateek!!!
It works. I really should get a good book on Ant...even though the online manual is quite good.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: quick question about TStamp in ant