Commit 12769990 by Tom Tromey Committed by Tom Tromey

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
parent 402d7dfe
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> 2001-05-12 Zack Weinberg <zackw@stanford.edu>
* Makefile.am (libgcj_la_OBJECTS): Remove libsupc++convenience.la. * Makefile.am (libgcj_la_OBJECTS): Remove libsupc++convenience.la.
......
...@@ -655,8 +655,6 @@ public class SimpleDateFormat extends DateFormat ...@@ -655,8 +655,6 @@ public class SimpleDateFormat extends DateFormat
found_zone = true; found_zone = true;
TimeZone tz = TimeZone.getTimeZone (strings[0]); TimeZone tz = TimeZone.getTimeZone (strings[0]);
theCalendar.setTimeZone (tz); theCalendar.setTimeZone (tz);
theCalendar.clear (Calendar.DST_OFFSET);
theCalendar.clear (Calendar.ZONE_OFFSET);
pos.setIndex(index + strings[k].length()); pos.setIndex(index + strings[k].length());
break; break;
} }
...@@ -709,6 +707,10 @@ public class SimpleDateFormat extends DateFormat ...@@ -709,6 +707,10 @@ public class SimpleDateFormat extends DateFormat
try 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(); return theCalendar.getTime();
} }
catch (IllegalArgumentException x) catch (IllegalArgumentException x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment