ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib ChangeLogParser.java ChangeLogWriter.java
Date Wed, 14 Aug 2002 23:13:05 GMT
sbailliez    2002/08/14 16:13:05

  Modified:    src/main/org/apache/tools/ant/taskdefs/cvslib
                        ChangeLogParser.java ChangeLogWriter.java
  Log:
  The date format seems to be in 24h format (did not have time to browse all
  docs but this is what I get on my machine so far) though it is clear that unlike
  all cvs commands the timezone is in UTC so I added an additional setup
  to configure the format with the utc timezone.
  
  The hour format has been changed from hh to HH to accomodate 24h.
  
  PR: 11582
  Reported by: m.mehrmann@fernuni-hagen.de (Mathias Mehrmann)
  
  Revision  Changes    Path
  1.15      +8 -5      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
  
  Index: ChangeLogParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ChangeLogParser.java	15 Apr 2002 23:53:14 -0000	1.14
  +++ ChangeLogParser.java	14 Aug 2002 23:13:05 -0000	1.15
  @@ -55,9 +55,7 @@
   
   import java.text.ParseException;
   import java.text.SimpleDateFormat;
  -import java.util.Date;
  -import java.util.Enumeration;
  -import java.util.Hashtable;
  +import java.util.*;
   
   /**
    * A class used to parse the output of the CVS log command.
  @@ -75,7 +73,12 @@
   
       /** input format for dates read in from cvs log */
       private static final SimpleDateFormat c_inputDate 
  -        = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
  +        = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
  +
  +    static {
  +        TimeZone utc = TimeZone.getTimeZone("UTC");
  +        c_inputDate.setTimeZone(utc);
  +    }
   
       //The following is data used while processing stdout of CVS command
       private String m_file;
  
  
  
  1.7       +8 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogWriter.java
  
  Index: ChangeLogWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogWriter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ChangeLogWriter.java	15 Apr 2002 15:33:11 -0000	1.6
  +++ ChangeLogWriter.java	14 Aug 2002 23:13:05 -0000	1.7
  @@ -56,6 +56,7 @@
   import java.io.PrintWriter;
   import java.text.SimpleDateFormat;
   import java.util.Enumeration;
  +import java.util.TimeZone;
   
   /**
    * Class used to generate an XML changelog.
  @@ -69,8 +70,13 @@
           = new SimpleDateFormat("yyyy-MM-dd");
       /** output format for times writtn to xml file */
       private static final SimpleDateFormat c_outputTime 
  -        = new SimpleDateFormat("hh:mm");
  +        = new SimpleDateFormat("HH:mm");
   
  +    static {
  +        TimeZone utc = TimeZone.getTimeZone("UTC");
  +        c_outputDate.setTimeZone(utc);
  +        c_outputTime.setTimeZone(utc);
  +    }
   
       /**
        * Print out the specifed entrys.
  
  
  

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


Mime
View raw message