GNOME Bugzilla – Bug 654347
g_time_zone_new_local is broken on Windows
Last modified: 2012-10-13 21:53:59 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.
Created attachment 191635 [details] [review] patch that maps from windows time zone id to olsen time zone id
Created attachment 191636 [details] [review] make the testcase pass
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.
*** This bug has been marked as a duplicate of bug 683998 ***