[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mktime makes wrong choice at spring DST
From: |
Geoff Kuenning |
Subject: |
Mktime makes wrong choice at spring DST |
Date: |
Sun, 1 Apr 2001 18:48:10 -0700 |
The mktime() function has an unfortunate implementation decsion. From
the comments:
/* We can't possibly find a match, as we are oscillating
between two values. The requested time probably falls
within a spring-forward gap of size DT. Follow the common
practice in this case, which is to return a time that is DT
away from the requested time, preferring a time whose
tm_isdst differs from the requested value. In practice,
this is more useful than returning -1. */
The problem is that this causes a request for 2:00 AM on 1-Apr-2001 to
be converted into 1:00 AM. This is wrong. In particular, it will
cause troubles for people who assume that DST starts at 2:01 instead
of 2:00, because a request for 2:00 won't produce the expected 3:00.
It seems to make much more sense to convert spring-DST changes
forward, following the practice of how people actually set their
clocks when they go to bed.
--
Geoff Kuenning address@hidden http://www.cs.hmc.edu/~geoff/
If a person is obviously mentally disabled, such as having Down's
syndrome or Alzheimer's, decent people exercise sympathy and
understanding in their interactions. So why, if someone merely has a
low IQ, is he treated with ridicule and contempt?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Mktime makes wrong choice at spring DST,
Geoff Kuenning <=