ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilbert Rebhan <>
Subject Re: How to set the next week start date
Date Fri, 27 Apr 2007 19:33:59 GMT


Ninju Bohra wrote:
> Have you looked at the <tstamp> task (
> Maybe something like:
> <tstamp>
>       <format property="touch.time" pattern="MM/dd/yyyy hh:mm aa"
>               offset="7" unit="week"/>
>   </tstamp>

i tried that on Win2000, with jdk 1.5.0_11 ant 1.6.5

<project name="project" default="main">
  <target name="depends">
      <format property="touch.time" pattern="mm/dd/yyyy hh:mm aa"
          offset="7" unit="week"/>

  <target name="main" depends="depends">
       Antversion == ${ant.version}
       Today == ${TODAY}

       $${touch.time} == ${touch.time}

and it gave me =

Buildfile: J:\eclipse_3_2\workspace\AntTest\tstamp.xml
      [echo] Antversion == Apache Ant version 1.6.5 compiled on June 2 2005
      [echo] Today == April 27 2007
      [echo] ${touch.time} == 19/15/2007 09:19 PM
Total time: 156 milliseconds

hm, strange 19/15/2007 ??

i think you meant something like =

	<format property="touch.time" pattern="MM/dd/yyyy hh:mm aa"
          offset="-7" unit="day"/>


	<format property="touch.time" pattern="MM/dd/yyyy hh:mm aa"
          offset="7" unit="day"/>

similar to the example from manual :

       <format property="touch.time" pattern="MM/dd/yyyy hh:mm aa"
               offset="-5" unit="hour"/>

but that gives him the actual date minus | plus 7 days.

 > Also when you say 'set the current date' what does that mean?
 > If you want to calculate what '7 days from now and set it to an ANT
 > property'
 >please look at the <tstamp> task otherwise please provide more 
 >explaination on what you need.

I thought the original poster was asking for

the next weeks start date and last week start date

because of that i suggested the <script> solution, where
he can choose, whether the start day of week = sunday or

Otherwise the </tstamp> would fit of course.

So he should provide some more details ;-)

Regards, Gilbert

> ----- Original Message ----
> From: Satheesh <>
> To: Ant Users List <>
> Sent: Friday, April 27, 2007 4:51:12 AM
> Subject: How to set the next week start date
> Hi Guys, If i want to set the current date its possible in ANT , even if i want a date
which is some 'n' days after the current date, that also is possible..
> I need a way to set the value of the next weeks start date and last week start date using
> How can i achieve this///

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message