[Gambas-user] System.TimeZone Error?

Benoît Minisini gambas at ...1...
Sun May 18 14:38:25 CEST 2014


Le 17/05/2014 21:55, Benoît Minisini a écrit :
> Le 17/05/2014 21:32, Benoît Minisini a écrit :
>> Le 10/05/2014 17:32, Wolfgang, dl7nb a écrit :
>>> Hi,
>>> System.TimeZone is defined as follows:
>>>
>>>      Return the system timezone.
>>>      The returned value is the number of seconds you must add to the
>>> locale time to get the UTC time.
>>>
>>> *That is not always done correctly. *
>>>
>>> During winter I used it and it has a result of 3600. This is correct as
>>> the difference between UTC and the time her in Germany is 1 hour (or
>>> 3600 seconds)
>>> -
>>> But now (summertime) we have daylight saving time, which means we have a
>>> difference of 2 hours. System.TimeZone still shows 3600. It should show
>>> 7200 to have the correct number of seconds.
>>> -
>>> So how can I find out what UTC.time really is??
>>> How can I solve this problem?
>>>
>>> regards Wolfgang
>>>
>>
>> Apparently, the daylight saving time is not taken into account. I'd like
>> to know how I can get this information from the system...
>>
>
> OK, I think I got it and understood what I did wrong...
>

Since revision #6273, System.TimeZone now takes the daylight saving time 
into account.

It's not technically the timezone anymore, but I can't change the 
property name. And concretely daylight saving time changes your timezone 
after all.

Note #1: knowing the current daylight saving time needs a GNU C library 
extension coming from BSD.

Note #2: this f.....g daylight saving time coming out of the brains of 
crazy politicians wanting to control time and who certainly had smoked 
illegal products should burn in fire.

-- 
Benoît Minisini




More information about the User mailing list