Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to name a file to a specific filename (xxxx_xxx_YYYYMMDD_HHMM) with ant

 
Sam Zou
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to create a tar file with ant but I want ant to
name it to a very specific filename :
xxxx_xxx_YYYYMMDD_HHMM

where Y = year, M = month, D = day, H = hour , M = minute

Basically it is the time and date where that file was created.


Is there a way to create such a filename with ant ?


Thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a seperate Ant forum where this question would be better posted.

You can use the tstamp task to create the time stamp and assign the value to a property. Something like this:
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Paul Sturrock:
There is a seperate Ant forum where this question would be better posted.

You can use the tstamp task to create the time stamp and assign the value to a property. Something like this:


Indeed. I will move this thread there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic