mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
38036a31d0
commit
97a43003c4
1 changed files with 3 additions and 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 */
|
* time in that way we actually need to add the timezone offset */
|
||||||
static timestamp_t current_time_notz(void)
|
static timestamp_t current_time_notz(void)
|
||||||
{
|
{
|
||||||
timestamp_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
GTimeZone *tz = g_time_zone_new_local();
|
struct tm *local = localtime(&now);
|
||||||
gint interval = g_time_zone_find_interval(tz, G_TIME_TYPE_UNIVERSAL, now);
|
return utc_mktime(local);
|
||||||
gint32 offset = g_time_zone_get_offset(tz, interval);
|
|
||||||
g_time_zone_unref(tz);
|
|
||||||
return now + offset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean starttime_focus_out_cb(GtkWidget *entry, GdkEvent * event, gpointer data)
|
static gboolean starttime_focus_out_cb(GtkWidget *entry, GdkEvent * event, gpointer data)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue