summaryrefslogtreecommitdiff
path: root/lib/gmtime.c
blob: b6fdd9e4c174713b4dd5378b17d2ae684cc15634 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
}