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: Sun, 31 Jan 2021 06:20:01 -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

Update of bug #59979 (project octave):

                Category:                    None => Octave Function        
              Item Group:                    None => WTF, Matlab?!?         
        Operating System:               GNU/Linux => Any                    

    _______________________________________________________

Follow-up Comment #7:

The code in comment #5 leads to a time just short of 20 minutes after midnight
in Octave:

>> format long
>> a = datenum ([2021, 1, 27, 17, 0, 0]);
>> b = datenum ([2021, 1, 27, 16, 40, 0]);
>> datevec (a-b)
ans =

  -1.000000000000000e+00   1.200000000000000e+01   3.100000000000000e+01      
                0   1.900000000000000e+01   5.999999888241291e+01


The component with the seconds rounds to 60 when displayed with less digits.
I'm not sure if it makes sense to "arbitrarily" round is this case...

The other question regarding the date part in Matlab's result is: There is no
0th of January on a Gregorian calendar. How does Matlab's datenum represent
the 31st of December 1 BCE?

    _______________________________________________________

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]