diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-14 17:40:29 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-14 17:40:29 +0000 |
commit | 1bb5ad7109f8e5c845ae9a5eb389d4d57d1b68f3 (patch) | |
tree | 628c987d6635347909a08299ba0eeefcd828985d /libjava | |
parent | 40e1e8fb245c25857bda06b05e291fcd5f6a5b04 (diff) | |
download | gcc-1bb5ad7109f8e5c845ae9a5eb389d4d57d1b68f3.tar.gz |
* java/text/SimpleDateFormat.java (parse): Clear DST_OFFSET and
ZONE_OFFSET just before computing the time.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42076 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/java/text/SimpleDateFormat.java | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 56784e0dbe3..e7baaadcb57 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2001-05-14 Tom Tromey <tromey@redhat.com> + + * java/text/SimpleDateFormat.java (parse): Clear DST_OFFSET and + ZONE_OFFSET just before computing the time. + 2001-05-12 Zack Weinberg <zackw@stanford.edu> * Makefile.am (libgcj_la_OBJECTS): Remove libsupc++convenience.la. diff --git a/libjava/java/text/SimpleDateFormat.java b/libjava/java/text/SimpleDateFormat.java index f0976054c63..5b366389c5d 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) |