After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654347 - g_time_zone_new_local is broken on Windows
g_time_zone_new_local is broken on Windows
Status: RESOLVED DUPLICATE of bug 683998
Product: glib
Classification: Platform
Component: win32
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-10 16:39 UTC by Shixin Zeng
Modified: 2012-10-13 21:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that maps from windows time zone id to olsen time zone id (19.89 KB, patch)
2011-07-10 16:40 UTC, Shixin Zeng
rejected Details | Review
make the testcase pass (1.03 KB, patch)
2011-07-10 16:40 UTC, Shixin Zeng
none Details | Review

Description Shixin Zeng 2011-07-10 16:39:33 UTC
g_time_zone_new calls g_time_zone_new with an olsen time zone name to create the time zone, where the olsen time zone name is obtained from the environmental variable 'TZ'. The problem with the method on Windows is that 'TZ' on windows has different format (TZ=tzn[+ | –]hh[:mm[:ss] ][dzn], http://msdn.microsoft.com/en-us/library/90s5c885%28v=vs.80%29.aspx) than on Linux. If we set the variable to the Linux format like 'America/Chicago', it will affect other functions like _ftime and localtime. So we can't rely on 'TZ' on Windows.

I'll attach a patch that maps the windows time zone name to olsen time zone name, the map is from http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml, I'm not quite sure the license of this file. Any help on this would be appreciated.
Comment 1 Shixin Zeng 2011-07-10 16:40:20 UTC
Created attachment 191635 [details] [review]
patch that maps from windows time zone id to olsen time zone id
Comment 2 Shixin Zeng 2011-07-10 16:40:47 UTC
Created attachment 191636 [details] [review]
make the testcase pass
Comment 3 John Ralls 2012-10-13 21:53:35 UTC
Comment on attachment 191635 [details] [review]
patch that maps from windows time zone id to olsen time zone id

Windows systems don't have the IANA zoneinfo database installed, so converting the Windows TZ name to the IANA names isn't going to help.
Comment 4 John Ralls 2012-10-13 21:53:59 UTC

*** This bug has been marked as a duplicate of bug 683998 ***