ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Twiggs, Glenn" <Glenn_Twi...@bmc.com>
Subject RE: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdef s Available.java defaults.properties Property.java Tstamp.java
Date Fri, 11 Feb 2000 16:02:12 GMT
The Tstamp task uses incorrect formatting strings for DSTAMP & TSTAMP: 

* Use the month format in DSTAMP (mm is minutes)
* Use the 24-hour hour format in TSTAMP (otherwise, at 7pm the TSTAMP will
be 0700 instead of 1900).


diff  jakarta-ant\src\main\org\apache\tools\ant\taskdefs\Tstamp.java
cvs diff: warning: unrecognized response `cvs: setgroups: Operation not
permitted' from cvs server
Index: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
===================================================================
RCS file:
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tst
amp.java,v
retrieving revision 1.2
diff -r1.2 Tstamp.java
75c75
<             SimpleDateFormat dstamp = new SimpleDateFormat ("yyyymmdd");
---
>             SimpleDateFormat dstamp = new SimpleDateFormat ("yyyyMMdd");
78c78
<             SimpleDateFormat tstamp = new SimpleDateFormat ("hhmm");
---
>             SimpleDateFormat tstamp = new SimpleDateFormat ("HHmm");



-----Original Message-----
From: stefano@locus.apache.org [mailto:stefano@locus.apache.org]
Sent: Thursday, February 10, 2000 7:31 PM
To: jakarta-ant-cvs@apache.org
Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs
Available.java defaults.properties Property.java Tstamp.java

<stuff deleted>
  
  1.3       +6 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
  
  Index: Tstamp.java
  ===================================================================
  RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tstamp.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Tstamp.java	2000/01/27 03:51:55	1.2
  +++ Tstamp.java	2000/02/11 01:31:24	1.3
  @@ -67,21 +67,20 @@
    */
   public class Tstamp extends Task {
   
  -    public void execute() throws BuildException {
  -
  +    public void init() throws BuildException {
           try {
               Date d = new Date();
  -            
  +
               SimpleDateFormat dstamp = new SimpleDateFormat ("yyyymmdd");
               project.setProperty("DSTAMP", dstamp.format(d));
  -    
  +
               SimpleDateFormat tstamp = new SimpleDateFormat ("hhmm");
               project.setProperty("TSTAMP", tstamp.format(d));
  -    
  +
               SimpleDateFormat today  = new SimpleDateFormat ("MMMM d
yyyy", Locale.US);
               project.setProperty("TODAY", today.format(d));
  -        } catch (Exception ex) {
  -            ex.printStackTrace();
  +        } catch (Exception e) {
  +            throw new BuildException(e);
           }
       }
   }
  
  
<stuff deleted>

Mime
View raw message