summaryrefslogtreecommitdiff
path: root/lib/gmtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gmtime.c')
-rw-r--r--lib/gmtime.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gmtime.c b/lib/gmtime.c
new file mode 100644
index 000000000..b6fdd9e4c
--- /dev/null
+++ b/lib/gmtime.c
@@ -0,0 +1,17 @@
+#include <time.h>
+#include <stdlib.h>
+
+time_t _xine_private_gmtime(struct tm *tm) {
+ time_t ret;
+ char *tz;
+
+ tz = getenv("TZ");
+ setenv("TZ", "", 1);
+ tzet();
+ ret = mktime(tm);
+ if (tz) setenv("TZ", tz, 1);
+ else unsetenv("TZ");
+ tzset();
+
+ return ret;
+}