1time_t mktimeUTC(struct tm* timeinfo)
2{
3 // *** enter in UTC mode
4 char* oldTZ = getenv("TZ");
5 putenv("TZ=UTC");
6 _tzset();
7 // ***
8
9 time_t ret = mktime ( timeinfo );
10
11 // *** Restore previous TZ
12 if(oldTZ == NULL)
13 {
14 putenv("TZ=");
15 }
16 else
17 {
18 char buff[255];
19 sprintf(buff,"TZ=%s",oldTZ);
20 putenv(buff);
21 }
22 _tzset();
23 // ***
24
25 return ret;
26}
27