Merge lp:~ken-vandine/gwibber/tz_dst_fixes into lp:gwibber

Proposed by Ken VanDine
Status: Merged
Merged at revision: 1315
Proposed branch: lp:~ken-vandine/gwibber/tz_dst_fixes
Merge into: lp:gwibber
Diff against target: 18 lines (+6/-2)
1 file modified
libgwibber/utils.vala (+6/-2)
To merge this branch: bzr merge lp:~ken-vandine/gwibber/tz_dst_fixes
Reviewer Review Type Date Requested Status
dobey (community) Approve
David Klasinc (community) Approve
Review via email: mp+97739@code.launchpad.net

Description of the change

determine if we are DST or not, and set isdst in the time struct. This fixes time being off by an hour for DST.

To post a comment you must log in.
lp:~ken-vandine/gwibber/tz_dst_fixes updated
1316. By Ken VanDine

use Time.local to determine isdst

Revision history for this message
David Klasinc (bigwhale) wrote :

Tabs, spaces! ;)

review: Approve
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libgwibber/utils.vala'
2--- libgwibber/utils.vala 2012-03-12 23:47:12 +0000
3+++ libgwibber/utils.vala 2012-03-15 20:03:21 +0000
4@@ -79,8 +79,12 @@
5
6 public string generate_time_string(uint t)
7 {
8- var now = (int)Time.gm (time_t ()).mktime();
9- var d = (int)(now - t);
10+ time_t _t = time_t ();
11+ Time n = Time.gm (_t);
12+ Time lt = Time.local (_t);
13+ n.isdst = lt.isdst;
14+ int now = (int)n.mktime ();
15+ int d = (int)(now - t);
16 if(d < 60)
17 return _("a few seconds ago");
18 if(d < 3600)