commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons/lang/src/java/org/apache/commons/lang/time DurationFormatUtils.java
Date Sat, 02 Oct 2004 01:40:30 GMT
bayard      2004/10/01 18:40:30

  Modified:    lang/src/java/org/apache/commons/lang/time
                        DurationFormatUtils.java
  Log:
  Calendar.setTimeInMillis(long) is a JDK 1.4 method, so reverting to an older variant
  
  Revision  Changes    Path
  1.20      +4 -3      jakarta-commons/lang/src/java/org/apache/commons/lang/time/DurationFormatUtils.java
  
  Index: DurationFormatUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/java/org/apache/commons/lang/time/DurationFormatUtils.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DurationFormatUtils.java	27 Sep 2004 04:49:07 -0000	1.19
  +++ DurationFormatUtils.java	2 Oct 2004 01:40:30 -0000	1.20
  @@ -18,6 +18,7 @@
   import org.apache.commons.lang.StringUtils;
   
   import java.util.Calendar;
  +import java.util.Date;
   import java.util.TimeZone;
   
   /**
  @@ -258,9 +259,9 @@
           // timezones get funky around 0, so normalizing everything to GMT 
           // stops the hours being off
           Calendar start = Calendar.getInstance(timezone);
  -        start.setTimeInMillis(startMillis);
  +        start.setTime(new Date(startMillis));
           Calendar end = Calendar.getInstance(timezone);
  -        end.setTimeInMillis(endMillis);
  +        end.setTime(new Date(endMillis));
   
           // initial estimates
           int years = end.get(Calendar.YEAR) - start.get(Calendar.YEAR);
  
  
  

---------------------------------------------------------------------
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