bugGNU Octave - Bugs: bug #47032, missing matlab datetime, duration,...


bug #47032: missing matlab datetime, duration, calendarDuration, and related functions

Submitter:  John Donoghue <lostbard>
Submitted:  Sun 31 Jan 2016 02:29:32 PM UTC
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Postponed Assigned to:  None
Originator Name:  JohnD Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Sat 10 Sep 2022 02:03:43 PM UTC, comment #7: 

Andrew github comment #6 their solution is now included in https://github.com/apjanke/octave-tablicious

Should this be linked with bug #44571

Thu 17 Jan 2019 11:25:16 AM UTC, comment #6: 

Hi folks.

I've written an implementation for datetime and friends:

It includes datetime, duration, and calendarDuration, and time zones are supported. Basic functionality is there, though it still needs a lot of work.

Code works on Octave 4.0.0 and later, though the `pkg install ...` bit needs Octave 4.4.x to work. Tested on a few combinations of macOS/Linux/Windows and Octave 4.0/4.2/4.4.

The code is an original work by me, GPLv3+. Thanks to Mike Miller for giving me an example of how an Octave pkg project repo layout works. It also includes redistributions of the IANA Time Zone Database (Public Domain) and the Unicode CLDR windowsZones.xml file (Unicode license); I think these are compatible with Octave's GPL licensing.

I have a Matlab license but this work was produced entirely with Octave, other Free software, and reference to publicly available documentation.

I welcome feedback and bug reports, either here or at https://github.com/apjanke/octave-addons-chrono/issues.

My hope is that this project can work its way through being an independent project, and External package on Octave Forge, and official Octave Forge package, and eventual inclusion in base Octave. Unless y'all have a better approach.

Andrew Janke <apjanke>
Fri 17 Aug 2018 07:02:04 PM UTC, comment #5: 

From what I remember, getting the duration object implemented quickly was far easier than working on the datetime and calendarDuration classes.

All functions are original works by me, licensed under GPLv3+ and ready for inclusion in Octave, and all include unit tests.

I'll keep working on this as time allows, and help from other contributors is very welcome. I'd like to have something a bit more complete before it is moved into Octave.

Mike Miller <mtmiller>
Group Member
Thu 16 Aug 2018 12:10:14 AM UTC, comment #4: 

I have made a start on some of the duration types and functions a couple months ago (May 2018). I will see what state it's in and post a link to a working repository. I'm happy if someone else wants to work on this as well, just wanted to share what I have so far.

Mike Miller <mtmiller>
Group Member
Sat 27 Feb 2016 11:04:20 AM UTC, comment #3: 

OK.  It turns out to be a mix in R2015b.  The following functions rely on datetime, or other types that I believe are currently unsupported by Octave:

yyyymmdd (input is type "datetime")
timezones (output is type "table")
years [and I assume days,hours,minutes,seconds,milliseconds] (input or output is type "duration")
calyears [and I assumecaldays,calmonths,calweeks,calquarters] (input or output is type "calendarDuration")
posixtime (input is type "datetime")
juliantime (input is type "datetime")
exceltime (input is type "datetime")

Lachlan Andrew <lachlan>
Sat 27 Feb 2016 02:21:21 AM UTC, comment #2: 

datetime looks like it uses the datetime data type.

Most of the others are just durations, where 1.0 is oe day, 365.2425 is a year etc.

John Donoghue <lostbard>
Group Member
Sat 27 Feb 2016 01:39:09 AM UTC, comment #1: 

John, I believe that these are not functions on existing data types, but only ones that relate to Matlab's new "datetime" data type, which Octave does not support.  Is that correct?

Lachlan Andrew <lachlan>
Sun 31 Jan 2016 02:29:32 PM UTC, original submission:  

Just to document it -  some missing date/time functions from matlab [1] - some are implemented via other functions:

datetime (matlab 2014)

timezones (matlab 2015b)

years,days,hours,minutes,seconds,milliseconds, duration (matlab  2014b)

calyears,caldays,calmonths,calweeks, calquarters, calDuration (matlab  2014b)

yyyymmdd (matlab 2014b)

posixtime (matlab 2014b)

juliandate (matlab 2014b)

exceltime (matlab 2014b)

[1] http://www.mathworks.com/help/matlab/create-date-and-time-arrays.html

John Donoghue <lostbard>
Group Member


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by apjanke (Posted a comment)
  • -email is unavailable- added by apjanke (added self to Cc)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by lostbard (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-01-14 apjanke Carbon-Copy- Added -email is unavailable-
    2018-08-17 mtmiller Summarymissing matlab date time functions missing matlab datetime, duration, calendarDuration, and related functions
    2018-08-16 rik5 Carbon-CopyRemoved 72865 -
    2018-08-16 rik5 Severity2 - Minor 1 - Wish
    2016-02-27 lachlan Priority5 - Normal 3 - Low
        StatusNone Postponed

    Back to the top

    Powered by Savane 3.13-c54d.
    Corresponding source code