Skip to content

Fixed change for EU: skips 1 hour at 1:00 UTC#2

Open
potter-s wants to merge 2 commits intoandydoro:masterfrom
potter-s:master
Open

Fixed change for EU: skips 1 hour at 1:00 UTC#2
potter-s wants to merge 2 commits intoandydoro:masterfrom
potter-s:master

Conversation

@potter-s
Copy link

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.

Simon Potter and others added 2 commits March 28, 2022 08:31
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).
@potter-s
Copy link
Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the comment note 1:00 AM as well?

@rika-hauser
Copy link

since RTCTime gives back the local time not UTC it differs depending in what time zone you are in.
For EU it should be <= 1 (less than 2:00 AM) and for UK it should be <= 0 (less than 1:00 AM).
To implement this the library would need to know the time zone it is working in though.

@Gambalunga
Copy link

Gambalunga commented Apr 9, 2025

Most of Europe changes at 1:00 AM GMT which is 2:00 AM local time (GMT + 1).
Western Europe, UK, Ireland, Portugal, also change at 1:00 AM GMT but they are also on GMT for local time.
As clocks will be set to local time (unless there is an algorithm for time zones (GMT + or -) it is best to calculate the change to DST using local time as the base.
For this reason I recommend that the EU rules remain as were and I have added a new set of rules for Western Europe (UK, Ireland and Portugal, all of which change at 1:00 local time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants