You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2014/09/18 18:08:16 UTC

svn commit: r1626014 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/DateConverter.java

Author: tilman
Date: Thu Sep 18 16:08:16 2014
New Revision: 1626014

URL: http://svn.apache.org/r1626014
Log:
PDFBOX-2356: correct handling of part hour timezones

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/DateConverter.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/DateConverter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/DateConverter.java?rev=1626014&r1=1626013&r2=1626014&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/DateConverter.java (original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/DateConverter.java Thu Sep 18 16:08:16 2014
@@ -439,10 +439,9 @@ public class DateConverter
     public static void adjustTimeZoneNicely(GregorianCalendar cal, TimeZone tz) 
     {
         cal.setTimeZone(tz);
-        int offset = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET))
-                / MILLIS_PER_HOUR;
-        cal.add(Calendar.HOUR, -offset);
-    }
+        int offset = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / 
+                MILLIS_PER_MINUTE;
+        cal.add(Calendar.MINUTE, -offset);    }
     
     /**
      * Parses the end of a date string for a time zone and, if one is found,