You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, raising an issue with timezones and accounting for DST (Daylight Savings Time) on ESP32
For some reason, tm tm_isdst is set to a value (0 or 1) leading the conversion in mktime to not automatically calculate isdst and instead use that overriden value.
The impact was that when using this function, DST was not properly being accounted for leading to incorrect set time.
Solution:
Add: tm.tm_isdst = -1;
Setting tm.tm_isdst to -1 before calling mktime causes it to do this calculation using the posix timezone (assuming its set) allowing for correct time setting.
I realize this project is not maintained anymore but just wanted to leave this fix here incase anyone else encountered it (took me a bit to pindown the root cause).
The text was updated successfully, but these errors were encountered:
File: https://github.com/rjwats/esp8266-react/blob/master/lib/framework/NTPSettingsService.cpp#L74
Hello, raising an issue with timezones and accounting for DST (Daylight Savings Time) on ESP32
For some reason, tm tm_isdst is set to a value (0 or 1) leading the conversion in mktime to not automatically calculate isdst and instead use that overriden value.
The impact was that when using this function, DST was not properly being accounted for leading to incorrect set time.
Solution:
Add:
tm.tm_isdst = -1;
Setting tm.tm_isdst to -1 before calling mktime causes it to do this calculation using the posix timezone (assuming its set) allowing for correct time setting.
See solution below:
I realize this project is not maintained anymore but just wanted to leave this fix here incase anyone else encountered it (took me a bit to pindown the root cause).
The text was updated successfully, but these errors were encountered: