bugGNU Octave - Bugs: bug #45635, Restore support for ISO8601 basic...

 
 

bug #45635: Restore support for ISO8601 basic calendar date

Submitted by:  Alexander List <alexlist>
Submitted on:  Mon 27 Jul 2015 08:16:14 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Other
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 28 Jul 2015 04:22:12 AM UTC, comment #2:

The Matlab numerical formats are documented here (http://www.mathworks.com/help/matlab/ref/datestr.html?nocookie=true#inputarg_formatOut). The changeset in question was done for Matlab compatibility, and I don't think we want to reverse that. We already get all kinds of complaints when we do things differently from Matlab, even if the behavior might be better.

Rik <rik5>
Project Administrator
Mon 27 Jul 2015 01:06:41 PM UTC, comment #1:

Hi, thanks for your bug report. As far as I can tell that change was made for Matlab compatibility. And it is described in the changeset message:

> Change numerical formats 21,22,29 to match Matlab.


where format 29 in Matlab is "yyyy-mm-dd". It had been incorrectly listed in Octave as "yyyymmdd" (or Matlab changed its format strings at some point).

Nothing precludes you from specifying whatever format you want to use of course in the 2-argument form. I can't comment on whether Octave would support additional builtin format strings beyond the ones that Matlab lists. Keep in mind those indexes are part of the API (unfortunately).

Mike Miller <mtmiller>
Project Administrator
Mon 27 Jul 2015 08:16:14 AM UTC, original submission:

Changeset 13848 (40e32fe44aaa) [1] fixing bug #34586 [2] also included this change:

- dateform{30} = "yyyymmdd";
+ dateform{30} = "yyyy-mm-dd";

This means that dateform{30} was changed from ISO 8601 basic calendar date to ISO 8601 extended calendar date.
https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates
http://www.cl.cam.ac.uk/~mgk25/iso-time.html

The description of the changeset and the bug do not contain a hint that this was intended, and it means an incompatible change:

octave:1> test=datestr("2005-12-31")
test = 31-Dec-2005
octave:2> test=datestr("20051231")
error: datevec: none of the standard formats match the DATE string
error: called from:
error: /usr/share/octave/3.8.2/m/time/datevec.m at line 133, column 11
error: /usr/share/octave/3.8.2/m/time/datestr.m at line 181, column 7

We suggest that the basic format is added back in, to restore backwards compatibility.

The attached patch is against a checkout from hg clone http://www.octave.org/hg/octave done today.

[0] http://hg.savannah.gnu.org/hgweb/octave/rev/40e32fe44aaa
[1] http://savannah.gnu.org/bugs/?34586

Alexander List <alexlist>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #34533:  datestr.diff added by alexlist (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by alexlist (Submitted the item)
  • -unavailable- added by alexlist
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 28 Jul 2015 04:22:12 AM UTCrik5StatusNone=>Wont Fix
      Open/ClosedOpen=>Closed
    Mon 27 Jul 2015 08:16:14 AM UTCalexlistAttached File-=>Added datestr.diff, #34533
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1