diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-02-27 19:43:18 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-27 09:58:53 -0800 |
commit | 97a43003c461427b99e1aa0dfc165841bdeaf90e (patch) | |
tree | dbdd82234aaa5f15c1afe227880e027453a2bbca /planner.c | |
parent | 38036a31d0c7b110d975e88277a5065ac6c1adbe (diff) | |
download | subsurface-97a43003c461427b99e1aa0dfc165841bdeaf90e.tar.gz |
Planner: use time.h and utc_mktime() to retrive the current time (no TZ)
This should do the same as the GTimeZone variant.
Also works on Windows.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r-- | planner.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1123,12 +1123,9 @@ static gboolean po2_focus_out_cb(GtkWidget *entry, GdkEvent * event, gpointer da * time in that way we actually need to add the timezone offset */ static timestamp_t current_time_notz(void) { - timestamp_t now = time(NULL); - 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; + time_t now = time(NULL); + struct tm *local = localtime(&now); + return utc_mktime(local); } static gboolean starttime_focus_out_cb(GtkWidget *entry, GdkEvent * event, gpointer data) |