time t c 2b 2b stack overflow

Solutions on MaxInterview for time t c 2b 2b stack overflow by the best coders in the world

showing results for - "time t c 2b 2b stack overflow"
Filippo
06 Nov 2020
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