directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1697148 - /directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java
Date Sun, 23 Aug 2015 03:32:45 GMT
Author: elecharny
Date: Sun Aug 23 03:32:45 2015
New Revision: 1697148

URL: http://svn.apache.org/r1697148
Log:
Using a Gregorian Calendar and a Locale.ENGLISH, as suggested by Uwe

Modified:
    directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java?rev=1697148&r1=1697147&r2=1697148&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java
(original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/api/util/GeneralizedTime.java
Sun Aug 23 03:32:45 2015
@@ -23,6 +23,8 @@ package org.apache.directory.api.util;
 import java.text.ParseException;
 import java.util.Calendar;
 import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.Locale;
 import java.util.TimeZone;
 
 import org.apache.directory.api.i18n.I18n;
@@ -185,7 +187,7 @@ public class GeneralizedTime implements
      */
     public GeneralizedTime( Date date )
     {
-        calendar = Calendar.getInstance();
+        calendar = GregorianCalendar.getInstance( Locale.ENGLISH );
         calendar.setTime( date );
         setUp( calendar );
     }
@@ -237,7 +239,7 @@ public class GeneralizedTime implements
 
         this.upGeneralizedTime = generalizedTime;
 
-        calendar = Calendar.getInstance();
+        calendar = GregorianCalendar.getInstance( Locale.ENGLISH );
         calendar.setTimeInMillis( 0 );
         calendar.setLenient( false );
 
@@ -424,7 +426,7 @@ public class GeneralizedTime implements
         double fract = Double.parseDouble( "0." + fraction );
         int millisecond = ( int ) Math.floor( fract * 1000 );
 
-        calendar.set( Calendar.MILLISECOND, millisecond );
+        calendar.set( GregorianCalendar.MILLISECOND, millisecond );
     }
 
 
@@ -675,7 +677,7 @@ public class GeneralizedTime implements
     public String toGeneralizedTime( Format format, FractionDelimiter fractionDelimiter,
int fractionLength,
         TimeZoneFormat timeZoneFormat )
     {
-        Calendar clonedCalendar = ( Calendar ) this.calendar.clone();
+        Calendar clonedCalendar = ( Calendar ) calendar.clone();
 
         if ( timeZoneFormat == TimeZoneFormat.Z )
         {



Mime
View raw message