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: Paul Netsaver
Subject: [Octave-bug-tracker] [bug #60107] datenum : 1 day missing from output?
Date: Wed, 24 Feb 2021 18:41:28 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36

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

Here's my five cents:

a) you are write, 'MM' in datenum format stands for minutes. Anyway, for me it
was misleading that 'YY' and 'DD' are not case sensitive and that symbols for
datenum arrays are: [Y,M,D,H,MN,S]. But it's ok as it is stated in Matlab
doc.

b) I cannot agree on convention: if a date is valid with years only, should be
completed with valid month/day.
According to your point, should be added a convention by which '2000' stands
for '2000 Jan 0' where this is an alias for '1999 Dec 31'...
The point is that a virtual zero-day of 2000 cannot belong by design to 2000
for 'datestr' and to 1999 for 'datenum', otherwise we get: 

datestr(datenum('00','yy'),'yy') = '99' (Octave)
datestr(datenum('00','yy'),'yy') = '99' (Matlab)

while on contrary:
datenum(datestr(730485)) = 730485 (Octave/Matlab)

Moreover, if we want Matlab-Octave compatible code, we have to consider 'yy'
an invalid date, or at least add a control for transforming: 'yy' to
'yy0101'.

datenum("2000 Jan 1","yyyy mmm dd")-datenum("2000","yyyy")
ans = 0 (Matlab)
ans = 1 (Octave)

datenum("2000 Jan 0","yyyy mmm dd")
error: datevec: DATE not parsed correctly with given format


    _______________________________________________________

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]