octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60107] datenum : 1 day missing from output?


From: Tasos Papastylianou
Subject: [Octave-bug-tracker] [bug #60107] datenum : 1 day missing from output?
Date: Wed, 24 Feb 2021 15:38:52 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0

Follow-up Comment #2, bug #60107 (project octave):

For what it's worth:

a) The original submission has a bug. The format string should be 'mm' not
'MM'. 'MM' stands for minutes, not months, and therefore reports zero minutes.
The same behaviour is seen in matlab too (so your example actually displays
'00' in matlab too). Months are 1-indexed, not 0-indexed, in both matlab and
octave.

b) As for the main 'bug', at the end of the day, it's behaviour that deviates
from matlab, I agree. But. The octave version actually makes more sense. I
would have been tempted to report this to matlab as a bug instead.

I get that at the end it's a design decision, but in my mind it makes perfect
sense that the "zeroth day of 2000" is actually 12 Dec 1999, such that offsets
relative to this date can be honoured. So, I would expect "2000 Jan 31st" -
"2000" to output 31, not 30. If I wanted 30 I would specify "2000-01-31" -
"2000-01-01" explicitly.

I understand matlab using the date 12th Dec of year -0001 arbitrarily as 0th
of 0, 0000, but even that causes more trouble than not. (especially since the
year -1 is actually 2BC). I actually found it more meaningful for "0000-01-01"
- 1 to output "-0001-12-31" (I see that this has now been updated/changed in
octave too, alas.)


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60107>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]