[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #36954] datenum converts date string incorrect
From: |
Philip Nienhuis |
Subject: |
[Octave-bug-tracker] [bug #36954] datenum converts date string incorrectly during DST start |
Date: |
Tue, 23 Aug 2016 15:17:19 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0 |
Follow-up Comment #10, bug #36954 (project octave):
Delving a bit into it I conclude that it is actually strptime() (called by
datevec.m in turn called by datenum.m) that is the culprit.
It looks like strptime() thinks that in the night of switching to DST, DST
starts at 02:00 AM sharp.
The fix could simply be making strptime() interpret DST start time to be 3:00
AM rather than 2:00 AM. After all, *actual* times between 2:00 AM and 3:00 AM
(2:00 AM incl.) do not exist in the night of switching to DST in spring, so if
a user supplies a date/time string with a time between 2:00 AM and 3:00 AM it
is probably explicitly meant to be a non-DST time string.
The complementary bug might exist at the time of switching back in fall but
there it is probably automatically neutralized. At least, I surmise that must
be the reason that no errors show up at those times.
I'm not so proficient in C++ so I hope someone more knowledgeable in C++ and
time.cc can fix this.
I had a look but I couldn't find where in time.cc the octave::sys::time t
variable is actually created.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?36954>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/