commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bur...@apache.org
Subject cvs commit: jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/tools ISO8601DateParser.java
Date Mon, 18 Oct 2004 20:21:00 GMT
burton      2004/10/18 13:21:00

  Modified:    feedparser/src/java/org/apache/commons/feedparser/tools
                        ISO8601DateParser.java
  Log:
  +00:00 instead of UTC
  
  Revision  Changes    Path
  1.5       +9 -8      jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/tools/ISO8601DateParser.java
  
  Index: ISO8601DateParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/tools/ISO8601DateParser.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ISO8601DateParser.java	18 Oct 2004 18:01:13 -0000	1.4
  +++ ISO8601DateParser.java	18 Oct 2004 20:21:00 -0000	1.5
  @@ -100,13 +100,9 @@
       }
   
       public static String toString( Date date ) {
  -        
  -        return toString( date, TimeZone.getTimeZone( "UTC" ) );
  -        
  -    }
  -
  -    public static String toString( Date date, TimeZone tz ) {
   
  +        TimeZone tz = TimeZone.getTimeZone( "UTC" );
  +        
           df.setTimeZone( tz );
   
           String output = df.format( date );
  @@ -117,7 +113,11 @@
           String s0 = output.substring( 0, output.length() - inset0 );
           String s1 = output.substring( output.length() - inset1, output.length() );
   
  -        return s0 + s1;
  +        String result = s0 + s1;
  +
  +        result = result.replaceAll( "UTC", "+00:00" );
  +        
  +        return result;
           
       }
   
  @@ -127,6 +127,7 @@
           System.out.println( parse( "2004-06-23T17:25:31-00:00" ) );
           System.out.println( parse( "2004-06-23T17:25:31Z" ) );
   
  +        //2002-10-02T10:00:00-05:00
           System.out.println( "v: " + toString( new Date( System.currentTimeMillis() ) )
);
   
       }
  
  
  

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


Mime
View raw message