summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-01-31 20:57:17 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-02 00:05:03 +1100
commit60f9c338e9ddcc18495758ac7ad6926cce5af44d (patch)
tree480f0486063ec40974b6b8a69048bfd27fafb8d1
parent326707800dfe23eb14858867f481b80856af46c8 (diff)
downloadsubsurface-60f9c338e9ddcc18495758ac7ad6926cce5af44d.tar.gz
planner.c: Use g_time_zone_find_interval()
current_time_notz(): Attempt to use g_time_zone_find_interval() to retrieve a timezone interval, which is then passed to g_time_zone_get_offset() Reported and tested-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--planner.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/planner.c b/planner.c
index 8a2d71990..7b3308869 100644
--- a/planner.c
+++ b/planner.c
@@ -1042,7 +1042,10 @@ static gboolean po2_focus_out_cb(GtkWidget *entry, GdkEvent * event, gpointer da
static timestamp_t current_time_notz(void)
{
timestamp_t now = time(NULL);
- int offset = g_time_zone_get_offset(g_time_zone_new_local(), 1);
+ GTimeZone *tz = g_time_zone_new_local();
+ gint interval = g_time_zone_find_interval(tz, G_TIME_TYPE_UNIVERSAL, now);
+ gint32 offset = g_time_zone_get_offset(tz, interval);
+ g_time_zone_unref(tz);
return now + offset;
}