Fixed change for EU: skips 1 hour at 1:00 UTC#2
Fixed change for EU: skips 1 hour at 1:00 UTC#2potter-s wants to merge 2 commits intoandydoro:masterfrom
Conversation
The change is at 2.00 BST, but 1.00 GMT, plus the inequality here is "<=", so we need 0 hours, not 1. 1 as written would see the change come into effect after 1:59 GMT (= 2:59 BST).
|
Changes proposed for both spring and autumn clock changes. I've tested these with a real clock, by setting the date to just before the time of adjustment. |
| { | ||
| if (previousSunday >= 25 // and it is also on or after 25th | ||
| && RTCTime.hour() <= 1) // less than 2:00 AM for Europe | ||
| && RTCTime.hour() <= 0) // less than 2:00 AM for Europe |
There was a problem hiding this comment.
shouldn't the comment note 1:00 AM as well?
|
since RTCTime gives back the local time not UTC it differs depending in what time zone you are in. |
|
Most of Europe changes at 1:00 AM GMT which is 2:00 AM local time (GMT + 1). |
In the UK at least (and likely the rest of the EU, according to https://en.wikipedia.org/wiki/Daylight_saving_time_by_country), the advance in spring is at 1.00 UTC, not 2.00 as coded. I only know as I was awake past 1.00 last Sunday and noticed it hadn't changed but it was correct next morning.