bugGNU Octave - Bugs: bug #45592, strftime problem with %z

 
 

bug #45592: strftime problem with %z

Submitted by:  Vic Norton <vicnorton>
Submitted on:  Mon 20 Jul 2015 09:42:37 PM UTC  
 
Category: LibrariesSeverity: 1 - Wish
Priority: 3 - LowItem Group: Feature Request
Status: FixedAssigned to: Mike Miller <mtmiller>
Originator Name: Vic NortonOpen/Closed: Closed
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 23 Jul 2015 12:32:01 AM UTC, comment #5:

Fixed on the default branch in the following changeset

http://hg.savannah.gnu.org/hgweb/octave/rev/31f89b12aaf7

Thanks again for noticing that this wasn't working, as you can see from the change a couple different pieces needed to be fixed to get this fully working.

Mike Miller <mtmiller>
Project AdministratorIn charge of this item.
Wed 22 Jul 2015 02:23:26 PM UTC, comment #4:

I think this is a reasonable enhancement and a pretty easy change, I'm looking at this (also document %z in the help text).

Mike Miller <mtmiller>
Project AdministratorIn charge of this item.
Tue 21 Jul 2015 01:53:26 PM UTC, comment #3:

I realize that %z is not a valid format carrier in Octave. Perhaps it
should be. For example an email message I recently received had
(partial) headers

The two times are identical. One is +0000 (UTC) time and the other is
-0400 (EDT) time. I believe the %z codes, +0000 and -0400, are much more
rational than the %Z codes, UTC and EDT. And, if the %z format is
standard in emails, perhaps Octave should start allowing it as well.

Vic Norton <vicnorton>
Tue 21 Jul 2015 03:15:38 AM UTC, comment #2:

Looked into this a bit, it is not the gnulib function that is to blame. Octave doesn't save/restore the "gmtoff" field in a struct tm when converting to and from octave values, so an uninitialized random value is passed to the underlying strftime C function.

This would be an enhancement to support the "%z" format conversion by preserving the "gmtoff" field correctly.

Mike Miller <mtmiller>
Project AdministratorIn charge of this item.
Tue 21 Jul 2015 01:34:57 AM UTC, comment #1:

I dont think %z is a valid format character according to the octave documentation.

%Z is though.

John Donoghue <lostbard>
Project Member
Mon 20 Jul 2015 09:42:37 PM UTC, original submission:

The commands
but
give gibberish in the time zone field.
See <http://search.cpan.org/~dexter/POSIX-strftime-GNU-0.0301/lib/POSIX/strftime/GNU.pm>.

Vic Norton <vicnorton>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 23 Jul 2015 12:32:01 AM UTCmtmillerStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Wed 22 Jul 2015 02:23:26 PM UTCmtmillerAssigned toNone=>mtmiller
    Tue 21 Jul 2015 03:15:38 AM UTCmtmillerSeverity3 - Normal=>1 - Wish
      Priority5 - Normal=>3 - Low
      Item GroupNone=>Feature Request
      StatusNone=>Confirmed
      Release3.8.2=>dev
    Mon 20 Jul 2015 09:42:37 PM UTCvicnortonCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1