winter and summer time switch without a break in the timeline

Does anybody know if there is a possibility to switch from summer- to wintertime without an interruption in the timeline. I have an application that logs transactions with a timestamp. The problem is, that I must not have overlapping timestamps. If I simply switch the clock from 3am to 2am i have an overlapping. Means that I can have two times the time 2:30 for example.

But if the time started to run twice as slow at 2 pm, I would have the correct time at 3pm without an interruption and without a broken timeline.

So does anybody know if there is a protocol that supports this? NTP does not seem to do that. And there is no chance to change the application, the last time we just stopped it for one hour, but there must be something better.


Solution 1:

I would log everything in UTC (Coordinated Universal Time), this way daylight saving is never observed. It is the common default time setting for Linux servers.

You can then present both the UTC and the local timezone time at the application layer.

Reading about the tzdata package might be of interest to you.

From that Wikipedia article:

UTC does not change with a change of seasons, but local time or civil time may change if a time zone jurisdiction observes daylight saving time or summer time. For example, UTC is 5 hours ahead of local time on the east coast of the United States during the winter but 4 hours ahead during the summer.

Solution 2:

No, there is no way to do this. Local time simply overlaps, there's nothing you can do about it. You could of course use some kind of sliding changeover during the DST changes, but that would further complicat things (e.g. timestamps during the changeover would be rather weird).

The easiest solution (probably the only solution) is to use UTC for logging timestamps. You can always convert the times to whatever local time you like when displaying them.