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

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

[Octave-bug-tracker] [bug #59979] Unexpected format for output from date


From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #59979] Unexpected format for output from datevec
Date: Mon, 1 Feb 2021 13:24:25 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36 Edg/88.0.705.56

Follow-up Comment #21, bug #59979 (project octave):

Matlab moved away from these function and uses datetime and duration objects
now.
I believe Andrew Janke has worked on that.

Maybe we should just abandon these functions and try to get the more modern
types that better describe a date or a duration.

But if someone wants to try to get this function to better mimick what Matlab
returns, I'll be happy to run tests or review.

Octave seems to implement the carry-over rules correctly from datevectors to
datestrings (although it needs an additional step through `datenum`):

>> datestr(datenum([2009 22 03 00 00 00]))
ans = 03-Oct-2010
>> datestr(datenum([2010 07 -05 00 00 00]))
ans = 25-Jun-2010


IIUC, this report is not about carry-over behavior but about rounding
behavior.

Fwiw, in Matlab R2020b:

>> datevec(datenum([2021 01 02 00 00 59.9999]))

ans =

   1.0e+03 *

    2.0210    0.0010    0.0020         0         0    0.0600



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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