ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Changing Date format
Date Thu, 30 Nov 2006 08:49:16 GMT
Custom task, like (pseudocode)

<scriptdef name="dateConvert" language="javascript">
    <attribute name="in"/>
    <attribute name="out"/>
    <![CDATA[
        in  = new java.io.File(attributes.get("in"));
        out = new java.io.File(attributes.get("out"));
        fIn  = new java.text.SimpleDateFormat("yyyy/MM/dd");
        fOut = new java.text.SimpleDateFormat("MMM dd, yyyy");
        while(line = in.readLine()) {
		out.writeln( fOut.format( fIn.parse(line) ));
        }
        in.close(); 
        out.close();
    ]]>
</scriptdef> 


Jan




>-----Urspr√ľngliche Nachricht-----
>Von: Pritesh Saharey [mailto:pritesh.saharey@wipro.com] 
>Gesendet: Donnerstag, 30. November 2006 08:05
>An: 'Ant Users List'
>Betreff: Changing Date format
>
>
>Dear All,
>         I had a file named "data", which contains the date of 
>an indefinite number in the format year/month/day;
>
>The Data file looks like this:
>
>Data
>-----
>1864/06/22
>1854/04/29
>1823/12/07
>:
>:
>:
>
>I want to change the format of this date so that the new 
>"datachnage" file will look something like this:
>
>Datachange
>----------
>(June 22, 1864)
>(April 29, 1854)
>(December 07, 1823)
>:
>:
>:
>
>Can anyone throw an idea on this?
>
>Regards,
>Pritesh
>
>
>
>
>The information contained in this electronic message and any 
>attachments to this message are intended for the exclusive use 
>of the addressee(s) and may contain proprietary, confidential 
>or privileged information. If you are not the intended 
>recipient, you should not disseminate, distribute or copy this 
>e-mail. Please notify the sender immediately and destroy all 
>copies of this message and any attachments. 
>
>WARNING: Computer viruses can be transmitted via email. The 
>recipient should check this email and any attachments for the 
>presence of viruses. The company accepts no liability for any 
>damage caused by any virus transmitted by this email.
> 
>www.wipro.com
>
>---------------------------------------------------------------------
>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