You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2013/06/08 02:01:31 UTC

svn commit: r1490878 - in /oodt/trunk: CHANGES.txt commons/src/main/java/org/apache/oodt/commons/date/DateUtils.java

Author: mattmann
Date: Sat Jun  8 00:01:31 2013
New Revision: 1490878

URL: http://svn.apache.org/r1490878
Log:
- fix for OODT-559 Unit test failure in testDoDynamicReplacement for "Europe/London" timezone
from Tom Barber 

Modified:
    oodt/trunk/CHANGES.txt
    oodt/trunk/commons/src/main/java/org/apache/oodt/commons/date/DateUtils.java

Modified: oodt/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/oodt/trunk/CHANGES.txt?rev=1490878&r1=1490877&r2=1490878&view=diff
==============================================================================
--- oodt/trunk/CHANGES.txt (original)
+++ oodt/trunk/CHANGES.txt Sat Jun  8 00:01:31 2013
@@ -4,6 +4,9 @@ Apache OODT Change Log
 Release 0.6 - Current Development
 --------------------------------------------
 
+* OODT-559 Unit test failure in testDoDynamicReplacement for "Europe/London" 
+  timezone (Tom Barber via mattmann)
+
 * OODT-615 Fixed bug in SolrCatalog that would throw exception if no matching products are found
            (luca)
 

Modified: oodt/trunk/commons/src/main/java/org/apache/oodt/commons/date/DateUtils.java
URL: http://svn.apache.org/viewvc/oodt/trunk/commons/src/main/java/org/apache/oodt/commons/date/DateUtils.java?rev=1490878&r1=1490877&r2=1490878&view=diff
==============================================================================
--- oodt/trunk/commons/src/main/java/org/apache/oodt/commons/date/DateUtils.java (original)
+++ oodt/trunk/commons/src/main/java/org/apache/oodt/commons/date/DateUtils.java Sat Jun  8 00:01:31 2013
@@ -206,7 +206,7 @@ public class DateUtils {
     }
     
     public static long getTimeInMillis(Calendar cal, Calendar epoch) throws Exception {
-        long epochDiffInMilli = epoch.getTimeInMillis() - julianEpoch.getTimeInMillis() ;
+        long epochDiffInMilli = epoch.getTimeInMillis() - (julianEpoch.getTimeInMillis()+julianEpoch.getTimeZone().getOffset(julianEpoch.getTimeInMillis())) ;
         if (cal.getTimeZone().getID().equals("TAI"))
             epochDiffInMilli += getLeapSecsForDate(epoch) * 1000;
         long milliseconds = cal.getTimeInMillis();