Browse Source

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)


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273224 13f79535-47bb-0310-9956-ffa450edef68
master
Stephane Bailliez 23 years ago
parent
commit
4e0fc1b369
2 changed files with 14 additions and 5 deletions
  1. +7
    -4
      src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
  2. +7
    -1
      src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogWriter.java

+ 7
- 4
src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java View File

@@ -55,9 +55,7 @@ package org.apache.tools.ant.taskdefs.cvslib;


import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; 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. * A class used to parse the output of the CVS log command.
@@ -75,7 +73,12 @@ class ChangeLogParser {


/** input format for dates read in from cvs log */ /** input format for dates read in from cvs log */
private static final SimpleDateFormat c_inputDate 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 //The following is data used while processing stdout of CVS command
private String m_file; private String m_file;


+ 7
- 1
src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogWriter.java View File

@@ -56,6 +56,7 @@ package org.apache.tools.ant.taskdefs.cvslib;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.TimeZone;


/** /**
* Class used to generate an XML changelog. * Class used to generate an XML changelog.
@@ -69,8 +70,13 @@ class ChangeLogWriter {
= new SimpleDateFormat("yyyy-MM-dd"); = new SimpleDateFormat("yyyy-MM-dd");
/** output format for times writtn to xml file */ /** output format for times writtn to xml file */
private static final SimpleDateFormat c_outputTime 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. * Print out the specifed entrys.


Loading…
Cancel
Save