ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: TimeStamp
Date Thu, 04 May 2006 06:04:35 GMT
AFIK there is none in Ant or AC - maybe there is an external task. 
But you could use scripting for that. I modified an old example for getting the filesize:


    <scriptdef name="getfd" language="javascript">
        <attribute name="file"/>
        <attribute name="property"/>
            fileName = attributes.get("file");
            propName = attributes.get("property");

            file = new;
            date = java.text.DateFormat.getDateTimeInstance().format(new java.util.Date(file.lastModified()));
            project.setNewProperty(propName, date);

    <getfd file="build.xml" property=""/>
    <echo>date of buildfile is ${}</echo>



>-----Urspr√ľngliche Nachricht-----
>Von: [] 
>Gesendet: Donnerstag, 4. Mai 2006 07:20
>An: Ant Users List
>Betreff: TimeStamp
>hi ,
>can anyone tell me how can i get the timestamp of a file in a 
>property..i am not getting the task for it.
>Ankur Agarwal
>Tata Consultancy Services Limited
>Notice: The information contained in this e-mail message 
>and/or attachments to it may contain confidential or 
>privileged information.   If you are not the intended 
>recipient, any dissemination, use, review, distribution, 
>printing or copying of the information contained in this 
>e-mail message and/or attachments to it are strictly 
>prohibited.   If you have received this communication in 
>error, please notify us by reply e-mail or telephone and 
>immediately and permanently delete the message and any 
>attachments.  Thank you

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message