ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject RE: Getting a relative time from within Ant
Date Wed, 07 Mar 2001 23:43:23 GMT
Diane,

Yes, I implemented it but I didn't document it. I'll rectify that as soon as
possible.

Here is the commit comment which explains usage.

Add the ability to specify time offsets when generating time/date property
strings.

Example usage:

  <target name="dateformats">
    <tstamp>
      <format property="now" pattern="dd/MM/yyyy HH:mm:ss.SS"/>
      <format property="then" offset="-1" unit="year"
              pattern="dd/MM/yyyy HH:mm:ss.SS"/>
    </tstamp>
    <echo message="now = ${now}, then = ${then}"/>
  </target>

Supported units are millisecond, second, minute, hour, day, week, month,
year. The unit is case insensitive

Sorry about missing that.

Conor


> -----Original Message-----
> From: Diane Holt [mailto:holtdl@yahoo.com]
> Sent: Thursday, 8 March 2001 4:52 AM
> To: ant-user@jakarta.apache.org
> Subject: Re: Getting a relative time from within Ant
>
>
> When the <tstamp> task was modified to take format specifications, Conor
> also proposed allowing for an offset/unit functionality that would allow
> you to specify something like:
>   offset="-10"
>   unit="minute"
> I was definitely in favor of it, but I don't know if he ever actually
> coded that up and committed it. You can see his mail about it at:
>   http://marc.theaimsgroup.com/?l=ant-dev&m=97852401318758&w=2
>
> Conor?
>
> Diane
>
> --- Chris Greenlee <CGreenlee@demandsolutions.com> wrote:
> > Hi all,
> >
> > As part of our automated build process, we're checking out our project
> > source into a clean directory on our build machine.  We're using CVS to
> > do this (and the cvs task), and it's working great.  But after reading
> > Martin Fowler's article on using ant and JUnit for doing continuous
> > integration testing
> > (http://www.martinfowler.com/articles/continuousIntegration.html), we've
> > decided we ought to be building testing the code that was checked in a
> > little while prior to the start time of the automated build.  That way
> > no one is in the process of checking in files and screwing up
> > dependencies when we grab a version to build and test.
> >
> > What I haven't been able to figure out is how we can get, from within
> > ant, the time ten minutes ago.  Using <tstamp/> we can get the current
> > date and time, but that's not what we need -- we're looking for that
> > time minus ten minutes.  Is there a way to do this?
> >
> > (For now we're using ${DSTAMP} along with a time passed in on the
> > command line, but that's not really an elegant solution.)
> >
> > Thanks in advance,
> >
> > Chris Greenlee
>
>
> =====
> (holtdl@yahoo.com)
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>


Mime
View raw message