- stamp = mktime(&tm_utc); // Convert the struct to a Unix timestamp
- putenv(time_zone); // Switch to destination time zone
+ results = ZDLookup(cd, latitude, longitude, NULL);
+ zone_selected = zd_tz(results);
+ time_zone = g_strconcat("TZ=", zone_selected, NULL);
+ time_zone_org = g_strconcat("TZ=", getenv("TZ"), NULL);
+ putenv("TZ=UTC");
+ g_free(zone_selected);
+
+ memset(&tm_utc, 0, sizeof(tm_utc));
+ if (text_date_time && strptime(text_date_time, "%Y:%m:%d:%H:%M:%S", &tm_utc))
+ {
+ stamp = mktime(&tm_utc); // Convert the struct to a Unix timestamp
+ putenv(time_zone); // Switch to destination time zone