Subject | Re: AW: AW: AW: [Firebird-Java] Timezones |
---|---|
Author | Roman Rokytskyy |
Post date | 2009-11-05T09:14:54Z |
>> Calendar utcCalendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));I confirm that conversion done with UTC or GMT time zones (see Calendar
>>
>> java.sql.Timestamp possibleFailureLocalCorrected =
>> test.decodeTimestamp(
>> test.decodeTimestamp(
>> test.encodeTimestamp(
>> test.encodeTimestamp(tsLocal, utcCalendar))), utcCalendar);
>>
>> System.out.println("Date " + timeLocal.toString() + " : " +
>> timeLocal.getTime() + " == " + possibleFailureLocalCorrected.getTime());
>>
>> Date Sun Oct 25 02:30:00 CET 2009 : 1256434200562 == 1256437800562
>
> Ah, did not pay attention to this difference... So using UTC is broken,
> but the local calendar is currently ok...
instance that is passed as a second parameter in PreparedStatement and
ResultSet classes) is broken for the DST. The bug does not affect the
conversions done with the system's default calendar.
Fix is committed to HEAD.
Roman