Re: [bugs] appointments on the day of setting the clock back from DST to standard time are off by 1 h

On Wed, Oct 31, 2018 at 04:58:18PM +0100, Marco van Hulten wrote:
> Sorry, I am not able to reproduce the invalid apts specification in
> this manner.  I have this in the broken apts file (adjusted the apt
> title):
>     10/28/2018 @ 02:59 -> 10/28/2018 @ 02:00|move clock one hour back

The appointment probably resulted from a known error in 4.3.0 that has been
corrected. It is not related DST. You can see it here:

I have found and corrected the paste error and a couple of other bugs to do
with DST. I am working on submitting patches to Github.

> So then I wondered how software in general handles the fact that all
> instances between 2:00 and 3:00 happen two times in this day.  I guess
> the best is to save times in GMT and use timezone information from the
> OS.

As you can see from the apts file, dates and times are saved in local time.
When loaded it is converted to Unix time which is seconds since 00:00:00, 1
January 1970 UTC. When displayed or saved it is converted back to local time.
The conversions and many time adjustments are performed by C library functions
which rely on a timezone database. But handling Unix time can be very confusing
and errorprone. To take the example you gave: an appointment with start time
02:00 and end time 03:00 on 28 October 2018 will get a duration of 2 hours in
Unix time (assuming the bug corrected).

Lars Henriksen