Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

quick question about TStamp in ant

 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Prateek!!!
It works. I really should get a good book on Ant...even though the online manual is quite good.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic