Posted: Wed May 13, 2009 2:48 am Post subject: DST problem in WMB 6.0
Newbie
Joined: 13 May 2009 Posts: 7
I noticed that for some datetime values WMB functions produce wrong DST offset. It seems as it uses wrong timezone DST table.
I have simple function to normalize datetime. It parses datetime and convert it back to string:
Code:
DECLARE dtPattern CONSTANT CHARACTER 'I';
CREATE FUNCTION NormalizeXsdDatetime (IN datetimeString CHARACTER) RETURNS CHARACTER
BEGIN
DECLARE parsed TIMESTAMP;
SET parsed = CAST(datetimeString AS TIMESTAMP FORMAT dtPattern);
RETURN CAST(parsed AS CHARACTER FORMAT dtPattern);
END;
Broker is configured to "Europe/Warsaw" timezone (TZ environment variable).
Then I invoke it on the following datetimes (Input tag) and get the following results (Normal tag):
<Input>1950-06-23T12:00:00.000+00:00</Input>
<Normal>1950-06-23T14:00:00.000+02:00</Normal>
--> this is wrong since in 1950 in Warsaw there was GMT+1 local time all year (no DST change)
<Input>1957-06-23T12:00:00.000+00:00</Input>
<Normal>1957-06-23T14:00:00.000+02:00</Normal>
--> this is OK
<Input>1962-06-23T12:00:00.000+00:00</Input>
<Normal>1962-06-23T14:00:00.000+02:00</Normal>
--> this is OK
<Input>1963-06-23T12:00:00.000+00:00</Input>
<Normal>1963-06-23T14:00:00.000+01:00</Normal>
--> this is wrong, because in Warsaw in 1963 there was DST time introduced from May 26;
also the time is wrong itself as it is 13:00 in GMT which is different from Input timestamp
<Input>1977-06-23T12:00:00.000+00:00</Input>
<Normal>1977-06-23T14:00:00.000+02:00</Normal>
--> this is OK
The same dates on Java have correct DST offsets.
It seems that WMB has historical localtime tables (it knows that in some years DST was not used), but for some reason the tables are wrong.
I checked the dates of DST start and end in all years from 1900 in WMB and comapared it with Java and they are simply different. If I change TZ to some other country the tables are corrent (the same as in Java).
My question is: does WMB have its own implementation of timezone tables or it uses the ones from Java or OS ?
The other issue is that the dates after normalization is some cases (where DST is not used) the hour is wrong (one hour earlier in GMT than original date).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum