This implementation calls GetTimeZoneInformation from <winapi/timezoneapi.h>, offsets the time from the input by the output of GetTimeZoneInformation, passes it to gmtime, and returns the result from gmtime.
I have verified that it does work correctly if it can't get the timezone or daylight savings is disabled, if it is daylight savings, and if it is not daylight savings. It also returns NULL if GetTimeZoneInformation returns TIME_ZONE_ID_INVALID.
This implementation calls
GetTimeZoneInformation
from<winapi/timezoneapi.h>
, offsets the time from the input by the output ofGetTimeZoneInformation
, passes it togmtime
, and returns the result fromgmtime
.I have verified that it does work correctly if it can't get the timezone or daylight savings is disabled, if it is daylight savings, and if it is not daylight savings. It also returns
NULL
ifGetTimeZoneInformation
returnsTIME_ZONE_ID_INVALID
.