GNOME Bugzilla – Bug 682167
Time is wrong for some places
Last modified: 2012-09-16 10:28:34 UTC
I think it's daylight saving related. I'm in UK, currently on BST (UTC+1). Time for Paris is correct (UTC+2) Time for Sydney is incorrect, one hour ahead of what it should be It's doing: time_here - difference_for_timezone_here (0 for UK, 1 hour for France) + difference_for_timezone_there (10 for Australia) the python time module can determine if we need to adjust for DST here. Libgweather has offsets for dst and non-dst, but I can't see a way to find whether dst is actually active.
Marking this as a blocker for 3.6.
After a bit of googling I'd say this is an issue with the libgweather package and one that has been known about for a while: https://bugzilla.gnome.org/show_bug.cgi?id=614607
Alex, I think we can fix this using GLib.DateTime instead of python's time. It has functions to handle timezones and we could get the timezone from GWeather. Do you think you can give it a try?
My idea was along these lines (untested): weather_timezone = self.location.get_timezone() timezone = GLib.TimeZone.new(weather_timezone.get_tzid()) i = timezone.find_interval(GLib.TimeType.UNIVERSAL, time.time()) self.offset = timezone.get_offset() However I fear we are currently blocked by #683167 :( (we could probably use pytz, but I would prefer to stick to the gnome stack without adding an external dependency)
I'm on holiday touring Southern Europe without a laptop until Wednesday (hence the flow of patches stopping). I'll have a look when I get back, unless someone else has a go first. When I was at home, I tried looking at how the old gnome panel did its world clocks stuff, because that seemed to work. If anyone else wants to work on this, they might want to track that code down.
Alex: don't worry, and if southern europe includes piedmont in Italy feel free to drop me a mail :)
Ok, now that GLib was fixed I used the approach I suggested above and things seems to work. Please reopen if time is still wrong for some timezones...