Should a time within the end of DST hour be considered Winter or Summer time?

198 Views Asked by At

As we know, when ever our clocks go 1h back (as they did on 29OCT at 2:00 in some countries) ending the DST period, every timestamp between 1:00 and 2:00 'occurs' twice.

How should an application working with future events handle this?

For example user creates a future event and specifies that it will take a place on 29OCT at 1:35. And let's assume that standard local time is UTC+3 and the DST is UTC+4

How should the application convert this time to UTC? Should this time be considered as the first instance (before end of DST, which makes it 21:35 UTC) or the second instance (after end of DST, i.e. 22:35 UTC)?

1

There are 1 best solutions below

2
On

Only you can decide that. It is largely based on context.

In many cases, the right thing to do is to choose the first of the two occurrences - which would be the daylight time. In your example, it would run at 1:35 in UTC+4.

You also need to consider the spring-forward transition. A recurring task that falls into the gap should usually be displaced by an amount equal to the DST bias (which is usually 1 hour). For example, if the clock jumps from 1:59:59.999 to 3:00, then a task scheduled to run at 2:30 would run at 3:30 on that day.

Again, only you can decide what is the right behavior for your application. Some applications may need the fall event to run at the standard time, or at both times. In the spring, they may want to run at the very next instant past the gap (3:00 in the above example, instead of 3:30) - or they may not want to run at all.

See also: