diff options
author | Tom Tromey <tromey@redhat.com> | 2001-05-14 17:40:29 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-05-14 17:40:29 +0000 |
commit | 127699902ef7b3e14ae7c3effb177fb7e2b9b20d (patch) | |
tree | 628c987d6635347909a08299ba0eeefcd828985d /libjava/java/text | |
parent | 402d7dfed56c92791609fe4e0d4d9d928a2a6971 (diff) | |
download | gcc-127699902ef7b3e14ae7c3effb177fb7e2b9b20d.zip gcc-127699902ef7b3e14ae7c3effb177fb7e2b9b20d.tar.gz gcc-127699902ef7b3e14ae7c3effb177fb7e2b9b20d.tar.bz2 |
SimpleDateFormat.java (parse): Clear DST_OFFSET and ZONE_OFFSET just before computing the time.
* java/text/SimpleDateFormat.java (parse): Clear DST_OFFSET and
ZONE_OFFSET just before computing the time.
From-SVN: r42076
Diffstat (limited to 'libjava/java/text')
-rw-r--r-- | libjava/java/text/SimpleDateFormat.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libjava/java/text/SimpleDateFormat.java b/libjava/java/text/SimpleDateFormat.java index f097605..5b36638 100644 --- a/libjava/java/text/SimpleDateFormat.java +++ b/libjava/java/text/SimpleDateFormat.java @@ -655,8 +655,6 @@ public class SimpleDateFormat extends DateFormat found_zone = true; TimeZone tz = TimeZone.getTimeZone (strings[0]); theCalendar.setTimeZone (tz); - theCalendar.clear (Calendar.DST_OFFSET); - theCalendar.clear (Calendar.ZONE_OFFSET); pos.setIndex(index + strings[k].length()); break; } @@ -709,6 +707,10 @@ public class SimpleDateFormat extends DateFormat try { + // Clear calendar fields here to force getTime() to correctly + // respect DST in the timezone. + theCalendar.clear (Calendar.DST_OFFSET); + theCalendar.clear (Calendar.ZONE_OFFSET); return theCalendar.getTime(); } catch (IllegalArgumentException x) |