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

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

[Octave-bug-tracker] [bug #47627] datenum input validation should be str


From: Aditya Manglik
Subject: [Octave-bug-tracker] [bug #47627] datenum input validation should be stricter
Date: Sat, 09 Apr 2016 04:40:51 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #5, bug #47627 (project octave):

The problem was not in datenum(), but in datevec().
Upon testing, I found that that datevec failed to determine the month value at
all when MM is used instead of mm, as was evident from the following
testcases:

datevec('2015-12-27 0:00','yyyy-MM-dd HH:MM')
datevec('2015-11-27 0:00','yyyy-mm-dd HH:MM')
datevec('2015-11-27 0:00','yyyy-MM-dd HH:MM')

The problem was that datevec was confusing 'MM' for minutes when passed as
uppercase in the string and was not determining the value of month passed in
f[]. It simply defaulted to month=1 for all cases, hence, giving wrong output
to datenum(), which in turn calculated wrong output itself.

After applying this patch, the function works correctly according to all the
std formats to be parsed, as defined in the file.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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