bugGNU Octave - Bugs: bug #49570, datenum gives incorrect results...

 
 

bug #49570: datenum gives incorrect results for month > 14

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Wed 09 Nov 2016 05:33:56 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 10 Nov 2016 05:13:33 AM UTC, comment #2: 

I pushed your fix to the stable branch here (http://hg.savannah.gnu.org/hgweb/octave/rev/bc9b0f75859e).

Fixed, closing report.

Rik <rik5>
Group administrator
Wed 09 Nov 2016 05:42:53 PM UTC, comment #1: 

Attached is a patch that fixes that issue.

(file #38915)

Markus Mützel <mmuetzel>
Group administrator
Wed 09 Nov 2016 05:33:56 PM UTC, original submission:  

While Matlab accepts months > 14 as an input to datenum moving those months to the subsequent years, Octave wraps them back one year (minus February).

Example in Octave:

>> datenum (4, 10:16,1)
ans =
   1736   1767   1797   1828   1859   1522   1553

>> diff (ans)
ans =
    31    30    31    31  -337    31


In Matlab:

>> datenum (4, 10:16,1)
ans =
        1736        1767        1797        1828        1859        1887        1918

>> diff (ans)
ans =
    31    30    31    31    28    31


Markus Mützel <mmuetzel>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-10 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2016-11-09 mmuetzel Attached File- Added bug49570_datenum_month.patch, #38915

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code