bugGNU Octave - Bugs: bug #54679, datenum accepts a matrix, which is...


bug #54679: datenum accepts a matrix, which is undocumented

Submitter:  None
Submitted:  Tue 18 Sep 2018 01:54:58 PM UTC
Category:  Documentation Severity:  2 - Minor
Priority:  3 - Low Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  8.4.0
Planned Release:  8.4.0
* Mandatory Fields

Add a New Comment Rich Markup

Thu 14 Sep 2023 06:34:15 PM UTC, comment #5: 

pushed apjanke's docstring patch for datenum to stable as

and a similar docstring patch for datevec as

closing report as fixed.

Nicholas Jankowski <nrjank>
Group Member
Tue 23 Nov 2021 01:31:34 AM UTC, comment #4: 

patch didn't push clean to current default tip.  updated the patch, moved the examples into the body of the docstring, and updated the texinfo around the examples. also simplified the last array example so the result was a bit cleaner.

as a simple documentation patch, this looks like it should be good to go.

(file #52326)

Nicholas Jankowski <nrjank>
Group Member
Fri 30 Jul 2021 03:37:18 AM UTC, comment #3: 

Can Andrew's patch be implemented?
The patch also provides examples, which is of benefit.

Sat 19 Jan 2019 06:21:59 AM UTC, comment #2: 

Here's a patch to add doco about datenum's nonscalar inputs: file #46024.

Andrew Janke <apjanke>
Tue 18 Sep 2018 08:18:28 PM UTC, comment #1: 

Thanks for this report.
Can you come up with patch or changeset, please? Documentation patches are really easy. Just edit the function, save it to another name and then do:

diff -u <original_function_file> <improved_function_file> > <some_file_name>.patch

A mercurial changeset would be really awesome.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 18 Sep 2018 01:54:58 PM UTC, original submission:  

datenum() accepts not only single values, but also a matrix of values to convert as an argument. This capability is undocumented.

The manual should state that all arguments to the function: YEAR, MONTH, DAY, HOUR, MINUTE, SECOND can be either numbers or arrays, and the result will correspondently be a number or an array:

octave> datenum(2018,9,7)
ans =  737310
octave> datenum(2018,9,[7 6])
ans =
   737310   737309

This is also true of the DATEVEC argument:

octave> datenum(datevec(datenum(2018,9,7)))
ans =  737310
octave> datenum([datevec(datenum(2018,9,7)); datevec(datenum(2018,9,6))])
ans =



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

Attach Files:

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 nrjank (Updated the item)
  • -email is unavailable- added by apjanke (Updated 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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-09-14 nrjank StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 8.4.0
        Planned ReleaseNone 8.4.0
    2021-11-23 nrjank Attached File- Added octave-datenum-doco-for-nonscalar-inputs_v2.patch, #52326
        Release4.4.1 dev
        Operating SystemGNU/Linux Any
    2021-11-11 nrjank StatusNone Patch Submitted
    2019-01-19 apjanke Attached File- Added octave-datenum-doco-for-nonscalar-inputs.patch, #46024
    2018-09-19 mtmiller Severity3 - Normal 2 - Minor
        Priority5 - Normal 3 - Low

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code