-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setTimeZone doesn't seem to be working correctly #6
Comments
Same thing here. Hint: |
Mine was failing on an ESP32 though, so it's not processor specific. |
Same issue on an ESP8266 on a Wemos D1 Mini Pro. As a workaround, I just inverted the timezone. For +5, I set it to -5 |
me too
DateTime.begin(); String str = " >>NTP对时成功," + DateTime.toString();
DateTime.setTime(t); |
|
ESP8266 does not support timezone, it just add timeZone * 3600 seconds to original timestamp. maybe esp8266/Arduino#7319 fixed this. |
fixed |
This is the built on the latest Arduino IDE. I've got the following which doesn't seem to be working correctly.
I print in loop() with the following
Where currentTimeZone is a function I have to that returns an integer timezone. Time must be set first, it needs to know the month and year. When I call DateTime.setTimeZone(), GMT is changed and in the wrong direction.
Local time when this printed was 10:15:05 AM. If I don't set the timezone, both are the same
Local time when this was printed was 10:24:18
Finally, if I pass it a positive timezone (5 instead of -5)
Local time when this was printed was 10:25:55
I'm using version 0.2.0 in the Arduino IDE.
*** Edit
I added a true/false check on the setTimeZone() function, and it returns true.
The text was updated successfully, but these errors were encountered: