summaryrefslogtreecommitdiff
path: root/lib/timegm.c
blob: 588131afb28c94a7b2fc1548cea02a3ff4e8b188 (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;
}