bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC]: NSTimeZone patch


From: Adam Fedor
Subject: [RFC]: NSTimeZone patch
Date: Tue, 5 Oct 2004 21:31:40 -0600

Automatically finding the system time zone is currently broken now (OK, I'll have to admit I'm partly responsible). If you don't set the time zone explicitly, NSTImeZone gets it from the tznam system function. However, tznam returns the abbreviation for the time zone. A previous post pointed out there is not currently a one-to-one correspondence between names and abbreviations. Even if there were, it would not always be correct. In fact, in some cases the GNUstep time zone files do not even have the required time zone file. For instance American/Los_Angeles returns the PST abbreviation, but the PST time zone file does not exist in the GNUstep time zone files.

This patch gets the time zone name directly using information available from the tzfile.h file, if possible, and also retrieves the time zone file from the system time zones first before checking the GNUstep time zones.

The down side is the time zone names are no longer portable between systems (of course they aren't really now with the current broken implementation). One way to fix that might be to encode the absolute offset of the time zone as well (I just thought of that so it's not addressed in this patch).

Attachment: zone.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]