XboxDev / nxdk-pdclib

The Public Domain C Library (adapted for original Xbox / nxdk toolchain)
http://pdclib.rootdirectory.de
Creative Commons Zero v1.0 Universal
19 stars 9 forks source link

Add localtime #55

Open PQCraft opened 1 year ago

PQCraft commented 1 year ago

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.