You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Bi...@mail.sprint.com on 2001/05/22 02:44:59 UTC

tstamp questions

Howdy all,
Beyond my highly unscientific (read: tedious) experimentations, what 
all options are there for the patterns that specifically relate to 
time.  I looked through Tstamp and CustomFormat for clues but didn't 
find too much.  The following was generated on a Solaris boxen (not 
that it should matter).  Any additions, corrections, observations would 
be much appreciated.

d will give me the day with a single or double digit
dd will give me the day in a double digit format

m will give me minutes with a single or double digit
mm will give me minutes with double digit format

M will give me month with a single or double digit
MM will give me month with double digit format

yy will give me year with double digit format
yyyy will give me year with four digit format

H will give me 24 hour time with a single or double digit
HH will give me 24 hour time with double digit format

h will give me 12 hour time with a single or double digit
hh will give me 12 hour time with double digit format
  not really sure how to tell A.M. or P.M. with this one

S will give me ? milliseconds ? with a single or double digit
SS will give me ? milliseconds ? with double digit format

s will give me seconds with a single or double digit
ss will give me seconds with double digit format

Re: tstamp questions

Posted by Suu Quan <sq...@wwc.com>.
After reading the discussion, I've arrived at this and just want to share
what I learned

   <property name="pattern1"
        value="EEEEEEEE dd MMMMMMMM yyyy hh:mm:ss:SSS aa zzzzzzzzzzz" />
        <!-- Tuesday 22 May 2001 10:22:38:242 AM Pacific Daylight Time -->

   <property name="pattern2" value="E d M y h'h' m'm' s's' S'ms' a z" />
      <!-- Tue 22 5 01 10h 31m 53s 670ms AM PDT -->
  <target name='init'>

<tstamp>
   <format property="MYTIMESTAMP1" pattern="${pattern1}" />
   <format property="MYTIMESTAMP2" pattern="${pattern2}" />
</tstamp>


Re: tstamp questions

Posted by Diane Holt <ho...@yahoo.com>.
There's the Javadoc for SimpleDateFormat, which is what <tstamp> uses:
http://java.sun.com/products/jdk/1.2/docs/api/java/text/SimpleDateFormat.html

(Guess we could make the reference to it in the doc a link.)

Diane

--- Bill.J.Fellows@mail.sprint.com wrote:
> Howdy all,
> Beyond my highly unscientific (read: tedious) experimentations, what 
> all options are there for the patterns that specifically relate to 
> time.  I looked through Tstamp and CustomFormat for clues but didn't 
> find too much.  The following was generated on a Solaris boxen (not 
> that it should matter).  Any additions, corrections, observations would 
> be much appreciated.
> 
> d will give me the day with a single or double digit
> dd will give me the day in a double digit format
> 
> m will give me minutes with a single or double digit
> mm will give me minutes with double digit format
> 
> M will give me month with a single or double digit
> MM will give me month with double digit format
> 
> yy will give me year with double digit format
> yyyy will give me year with four digit format
> 
> H will give me 24 hour time with a single or double digit
> HH will give me 24 hour time with double digit format
> 
> h will give me 12 hour time with a single or double digit
> hh will give me 12 hour time with double digit format
>   not really sure how to tell A.M. or P.M. with this one
> 
> S will give me ? milliseconds ? with a single or double digit
> SS will give me ? milliseconds ? with double digit format
> 
> s will give me seconds with a single or double digit
> ss will give me seconds with double digit format
> 


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/