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

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

[Octave-bug-tracker] [bug #50508] datenum() crashes for non-integer mont


From: Lars Kindermann
Subject: [Octave-bug-tracker] [bug #50508] datenum() crashes for non-integer month arrays
Date: Wed, 15 Mar 2017 09:58:40 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0

Follow-up Comment #7, bug #50508 (project octave):

this works fine now:


>> datestr(datenum(2000:2004,2.5,1, 0,0,0))
ans =

15-Feb-2000 12:00:00
15-Feb-2001 00:00:00
15-Feb-2002 00:00:00
15-Feb-2003 00:00:00
15-Feb-2004 12:00:00


add one hour


>> datestr(datenum(2000:2004,2.5,1, 1,0,0))
ans =

15-Feb-2000 13:00:00
15-Feb-2001 01:00:00
15-Feb-2002 01:00:00
15-Feb-2003 01:00:00
15-Feb-2004 13:00:00


that looks good, too, same with 11 hours


>> datestr(datenum(2000:2004,2.5,1, 11,0,0))
ans =

15-Feb-2000 23:00:00
15-Feb-2001 11:00:00
15-Feb-2002 11:00:00
15-Feb-2003 11:00:00
15-Feb-2004 23:00:00


but what happens with 12 hours on non leap years?


>> datestr(datenum(2000:2004,2.5,1, 12,0,0))
ans =

16-Feb-2000
15-Feb-2001
15-Feb-2002
15-Feb-2003
16-Feb-2004


I slowly understand why matlab people decided to not support fractional month
but just round it down...

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50508>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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