summaryrefslogtreecommitdiff
path: root/lib/timegm.c
blob: 182a1b527ff167dcdd1766446f06c3e942db6c91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "config.h"

#include <time.h>
#include <stdlib.h>

time_t _xine_private_timegm(struct tm *tm) {
  time_t ret;
  char *tz;

  tz = getenv("TZ");
  setenv("TZ", "", 1);
  tzset();
  ret = mktime(tm);
  if (tz) setenv("TZ", tz, 1);
  else unsetenv("TZ");
  tzset();

  return ret;
}