GNOME Bugzilla – Bug 664237
GDateTime falls back to UTC if TZ is set
Last modified: 2012-02-06 19:29:51 UTC
Everytime TZ is set, GDateTime (actually GTimeZone) fails to retrieve the zoneinfo file and falls back to UTC. Patch following.
Created attachment 201565 [details] [review] gtimezone: consider a leading : in TZ environment variable When set to represent a zoneinfo file, TZ must start with :, therefore glib must ignore the first char when building the resulting filename, or it won't be found.
In fact, there's this: http://www.gnu.org/s/hello/manual/libc/TZ-Variable.html This should be what we aim for. glibc does a good job of doing things not in this spec (for example, it allows TZ=America/Toronto directly, with no ':'). I'd like not to exclude these cases as well, since people are probably likely to set their TZ variable based on what they see glibc allowing.
Created attachment 201604 [details] [review] gtimezone: consider a leading : in TZ environment variable When set to represent a zoneinfo file, TZ may start with :, therefore glib needs to check it and ignore the first char when building the resulting filename, or it won't be found. Also, the path could be absolute, in which case it is wrong to append /usr/share/timezone
Almost 3 months later, any review on this (just to get it off my inbox)?
Review of attachment 201604 [details] [review]: Sorry that this fell off the radar.
Attachment 201604 [details] pushed as 1faed13 - gtimezone: consider a leading : in TZ environment variable