[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] java/text/SimpleDateFormat.java(parse): set time zone offse
From: |
Ito Kazumitsu |
Subject: |
[cp-patches] java/text/SimpleDateFormat.java(parse): set time zone offset |
Date: |
25 Jan 2005 15:14:44 -0000 |
User-agent: |
SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/21.3.50 (i386-unknown-freebsd5.3) MULE/5.0 (SAKAKI) |
Hi,
As reported in
http://www.kaffe.org/pipermail/kaffe/2005-January/101298.html
the method parse of java/text/SimpleDateFormat.java has a bug
of failing to set the time zone offset. And I suggetst the
following patch.
ChangeLog:
2005-01-25 Ito Kazumitsu <address@hidden>
* java/text/SimpleDateFormat.java
(parse): Set the time zone offset for "GMT+hh:mm".
####
--- java/text/SimpleDateFormat.java.orig Tue Jan 25 00:31:59 2005
+++ java/text/SimpleDateFormat.java Wed Jan 26 00:00:11 2005
@@ -840,7 +840,7 @@
// We need a special case for the timezone, because it
// uses a different data structure than the other cases.
is_numeric = false;
- calendar_field = Calendar.DST_OFFSET;
+ calendar_field = Calendar.ZONE_OFFSET;
String[][] zoneStrings = formatData.getZoneStrings();
int zoneCount = zoneStrings.length;
int index = pos.getIndex();
@@ -868,8 +868,8 @@
found_zone = true;
saw_timezone = true;
TimeZone tz = TimeZone.getTimeZone (strings[0]);
- calendar.set (Calendar.ZONE_OFFSET, tz.getRawOffset
());
- offset = tz.getDSTSavings();
+ calendar.set (Calendar.DST_OFFSET,
tz.getDSTSavings());
+ offset = tz.getRawOffset ();
pos.setIndex(index + strings[k].length());
break;
}
####
- [cp-patches] java/text/SimpleDateFormat.java(parse): set time zone offset,
Ito Kazumitsu <=