You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Steve Cohen <SC...@sportvision.com> on 2003/09/01 21:58:05 UTC

Timestamp attribute processing

There have been some requests to add functionality to the stcheckout task (for StarTeam) to enable checkout by a timestamp.  It will not be hard to do this, as the scenario is well-supported in the StarTeam API.  

However, what about the Ant API?  Is there a standard way (and reusable/accessible code) for passing in timestamps as attributes to a task?  It seems like a bad idea for every task to roll its own date-parse processing.  Can someone point me at a better way to implement it in ant?  Ideally this would support at least yyyy-MM-dd, yyyy-MM-dd hh:mm without making the user supply a date-format string.

Re: Timestamp attribute processing

Posted by Stefan Bodewig <bo...@apache.org>.
there also is a datetime attribute in <touch>.  Would be nice to unify
them - at least Java code wise.

On Mon, 1 Sep 2003, Antoine Levy-Lambert <an...@antbuild.com> wrote:

> (with a hardcoded US locale, looks like the europeans (continentals)
> are not allowed to enter DD-MM-YYYY dates, MM-DD-YYYY is preferred.

The reason is that you don't have to care about the user's locale
(user being the one who runs the build script).  For a reason unknown
to me, cron on RedHat 7.3 doesn't use the default locale of the
installed OS for example.

<OT>I could easily patch its environment but I've come to like the
fact that my code gets compiled and run on a different locale than my
default locale in nightly builds.  This has caught some locale
dependencies in my code in the past.</OT>.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Re: Timestamp attribute processing

Posted by Antoine Levy-Lambert <an...@antbuild.com>.
- there is a date selector with a method DateSelector#setDateTime which
contains parsing code (with a hardcoded US locale, looks like the europeans
(continentals) are not allowed to enter DD-MM-YYYY dates, MM-DD-YYYY is
preferred.

- there is a DateUtils class in ant  It has methods to format dates, but not
to parse them. Parsing methods should be added there.

- the cvstagdiff task has attributes which are date/timestamps, but the task
does not parse these attributes itself, rather they are copied without
parsing as command line arguments for the cvs executable.

- the tstamp task can create strings (properties) representing dates, but
does not have to parse the strings back

Cheers,

Antoine
----- Original Message -----
From: "Steve Cohen" <SC...@sportvision.com>
To: <an...@apache.org>
Sent: Monday, September 01, 2003 9:58 PM
Subject: Timestamp attribute processing


There have been some requests to add functionality to the stcheckout task
(for StarTeam) to enable checkout by a timestamp.  It will not be hard to do
this, as the scenario is well-supported in the StarTeam API.

However, what about the Ant API?  Is there a standard way (and
reusable/accessible code) for passing in timestamps as attributes to a task?
It seems like a bad idea for every task to roll its own date-parse
processing.  Can someone point me at a better way to implement it in ant?
Ideally this would support at least yyyy-MM-dd, yyyy-MM-dd hh:mm without
making the user supply a date-format string.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org