You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/11/06 16:03:54 UTC

DO NOT REPLY [Bug 24470] New: - Add new timestamp properties, MSTAMP and SSTAMP

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24470>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24470

Add new timestamp properties, MSTAMP and SSTAMP

           Summary: Add new timestamp properties, MSTAMP and SSTAMP
           Product: Ant
           Version: 1.1
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: fabrewer03@earthlink.net


Inspired by the usage of 'seconds since the era' in Donald Knuth's MMIX package.

Here is the diff that works for me.

diff -r -u tools/ant/taskdefs/Tstamp.java src/lib/taskdefs/Tstamp.java
--- tools/ant/taskdefs/Tstamp.java	2003-08-11 21:11:07.000000000 -0700
+++ src/lib/taskdefs/Tstamp.java	2003-11-06 07:01:19.000000000 -0800
@@ -80,6 +80,7 @@
  * @author roxspring@yahoo.com
  * @author Conor MacNeill
  * @author Magesh Umasankar
+ * @author Fred Brewer
  * @since Ant 1.1
  * @ant.task category="utility"
  */
@@ -118,6 +119,10 @@
             SimpleDateFormat dstamp = new SimpleDateFormat ("yyyyMMdd");
             setProperty("DSTAMP", dstamp.format(d));
 
+	    setProperty("MSTAMP", Long.toString(d.getTime()));
+
+	    setProperty("SSTAMP", Long.toString(d.getTime()/1000));
+
             SimpleDateFormat tstamp = new SimpleDateFormat ("HHmm");
             setProperty("TSTAMP", tstamp.format(d));

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