ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Woo, Chen Ching" <c...@spss.com>
Subject RE: Any date format task?
Date Wed, 12 Mar 2003 15:05:12 GMT
Thanks Jan, I'll try that out.

-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
Sent: Wednesday, March 12, 2003 12:58 AM
To: user@ant.apache.org
Subject: AW: Any date format task?


AFAIK there is nothing "Date"-specific. But you can use the optional task
<replaceregexp>.


<replaceregexp
    file="aFileWithMyTimestamp"
 
match="tstamp.old=([1-2][0-9][0-9][0-9])([0-1]?[0-9]?)([0-3]?[0-9]?)([0-2]?[
0-9]?)([0-5]?[0-9]?)([0-5]?[0-9]?)"
    replace="tstamp.new=\1.\2.\3.\4:\5:\6"
    byline="true"
/>

Testdata:
tstamp.old=20030312075500
tstamp.old=200303120755
tstamp.old=2003031207
tstamp.old=20030312
tstamp.old=200303
tstamp.old=2003

Testresult:
tstamp.new=2003.03.12.07:55:00
tstamp.new=2003.03.12.07:55:
tstamp.new=2003.03.12.07::
tstamp.new=2003.03.12.::
tstamp.new=2003.03..::
tstamp.new=2003...::


Jan Matèrne


-----Ursprüngliche Nachricht-----
Von: Woo, Chen Ching [mailto:cwoo@spss.com]
Gesendet am: Dienstag, 11. März 2003 21:29
An: Ant Users List
Betreff: RE: Any date format task?

The <timestamp> seemed to use the current time, but I've a timestamp value
available through a property. In other words, it would be nice if I could
use the <format> task with an input timestamp string to format.

-----Original Message-----
From: M. Erik Husby [mailto:mhusby@genome.wi.mit.edu]
Sent: Tuesday, March 11, 2003 2:23 PM
To: Ant Users List
Subject: Re: Any date format task?


Read the documentation on the TSTAMP task. It can do what you ask.

Woo, Chen Ching wrote:

>Is there a task available to format a timestamp from the format of
yyyymmddhhmmss to something else, say yyyy.mm.dd.hh:mm:ss ?
>Thanks
>
>chen.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>  
>

-- 
Erik Husby
Team Lead for Software Quality Automation
Whitehead Institute/MIT Center for Genome Research
320 Charles St
Cambridge, MA 02141-2023
mobile: 781.354.6669
office: 617.258.9227
mhusby@genome.wi.mit.edu




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


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

Mime
View raw message