bugGNU Octave - Bugs: bug #42241, datevec() should allow partial...

 
 

bug #42241: datevec() should allow partial matches when format is specified

Submitted by:  Ben Kurtz <bkurtz>
Submitted on:  Wed 30 Apr 2014 08:00:40 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 15 Dec 2016 03:03:25 PM UTC, comment #2:

This issue is still present in Octave 4.2.0.

The second code line from comment #0 still throws an error in Ocave.

There is a proposal for a PATCH in comment #0.

Hartmut <hardy>
Wed 30 Apr 2014 08:01:59 AM UTC, comment #1:

Also, I've done this a couple of times and I'm not sure what the best procedure is; for simple stuff like this, should I submit it as a 'bug' or a 'patch' in Savannah?

Ben Kurtz <bkurtz>
Wed 30 Apr 2014 08:00:40 AM UTC, original submission:

In MATLAB if I specify the format for a date, anything that matches will parse:

This is useful when:

  • date is part of a filename (don't have to write/run code to strip the tail end before parsing)
  • just want the date of a date/time string of known format

The current octave implementation throws errors for both calls, because it requires the full input string to match the format.

Attaching a patch that makes the behavior more like MATLAB, i.e. if a format is specified, the conversion will work as long as the string matches the format, even if there are extra characters at the end.

Ben Kurtz <bkurtz>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #31281:  datevec.patch added by bkurtz (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hardy (Posted a comment)
  • -unavailable- added by bkurtz (Submitted the item)
  •  

    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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 30 Apr 2014 08:00:40 AM UTCbkurtzAttached File-=>Added datevec.patch, #31281

    Back to the top


    Powered by Savane 3.1-cleanup1