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 682167 - Time is wrong for some places
Time is wrong for some places
Status: RESOLVED FIXED
Product: gnome-clocks
Classification: Applications
Component: general
unspecified
Other Linux
: Immediate blocker
: ---
Assigned To: Clocks maintainer(s)
Clocks maintainer(s)
Depends on: 683167
Blocks:
 
 
Reported: 2012-08-18 16:36 UTC by Alex Anthony
Modified: 2012-09-16 10:28 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alex Anthony 2012-08-18 16:36:24 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.
Comment 1 Allan Day 2012-08-19 11:45:51 UTC
Marking this as a blocker for 3.6.
Comment 2 Emily Gonyer 2012-08-20 14:26:11 UTC
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
Comment 3 Paolo Borelli 2012-08-31 19:02:46 UTC
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?
Comment 4 Paolo Borelli 2012-09-01 20:19:24 UTC
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)
Comment 5 Alex Anthony 2012-09-01 20:29:55 UTC
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.
Comment 6 Paolo Borelli 2012-09-01 20:44:54 UTC
Alex: don't worry, and if southern europe includes piedmont in Italy feel free to drop me a mail :)
Comment 7 Paolo Borelli 2012-09-16 10:28:34 UTC
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...