Backport #8608

Inconsistent parse of DateTime zone specification with seconds

Added by Riley Lynch over 2 years ago. Updated about 2 years ago.

Assignee:Tomoyuki Chikanaga


When a time zone specification has a single-digit hour and includes minutes and seconds without colons, the minutes offset is overwritten by the seconds offset. In this example +3:30 is incorrectly parsed as +3:00:

DateTime.parse('6 Nov 1973 18:45 +33000') # => #

This defect is not present when the hour is specified by two digits:

DateTime.parse('7 Nov 1973 04:00 +124500') # => #

Attached is a patch which corrects this issue.

tz_sec.patch Magnifier - Patch for trunk@41825 (c51615963) (439 Bytes) Riley Lynch, 07/08/2013 12:31 AM

Associated revisions

Revision 41951
Added by Tomoyuki Chikanaga about 2 years ago

merge revision(s) 41871: [Backport #8608]

* ext/date/date_parse.c (date_zone_to_diff): .


#1 Updated by Tomoyuki Chikanaga over 2 years ago

  • Status changed from Open to Assigned
  • Assignee set to tadayoshi funaba

The patch seems quite simple and reasonable.
funaba-san, could you review the patch?

#2 Updated by tadayoshi funaba about 2 years ago

  • Assignee changed from tadayoshi funaba to Tomoyuki Chikanaga

backport r41871.

#3 Updated by Tomoyuki Chikanaga about 2 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby trunk to Backport200
  • Category deleted (ext)

#4 Updated by Tomoyuki Chikanaga about 2 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41951.
Riley, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

merge revision(s) 41871: [Backport #8608]

* ext/date/date_parse.c (date_zone_to_diff): .

Also available in: Atom PDF