Horje
time_t c++ stack overflow Code Example
time_t c++ stack overflow
time_t mktimeUTC(struct tm* timeinfo)
{
    // *** enter in UTC mode
    char* oldTZ = getenv("TZ");
    putenv("TZ=UTC");
    _tzset();
    // ***

    time_t ret = mktime ( timeinfo );

    // *** Restore previous TZ
    if(oldTZ == NULL)
    {
        putenv("TZ=");
    }
    else
    {
        char buff[255];
        sprintf(buff,"TZ=%s",oldTZ);
        putenv(buff);
    }
    _tzset();
    // ***

    return ret;
}




Cpp

Related
input 5 numbers and print their sum using while loop Code Example input 5 numbers and print their sum using while loop Code Example
array in c++ Code Example array in c++ Code Example
c++ convert template function to normal function Code Example c++ convert template function to normal function Code Example
# in c++ Code Example # in c++ Code Example
1603. Design Parking System leetcode solution in c++ Code Example 1603. Design Parking System leetcode solution in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8