Backport #8608

Inconsistent parse of DateTime zone specification with seconds

Added by Riley Lynch 10 months ago. Updated 9 months ago.

[ruby-core:55831]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

Description

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 9 months ago

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

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

History

#1 Updated by Tomoyuki Chikanaga 10 months 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 10 months ago

  • Assignee changed from tadayoshi funaba to Tomoyuki Chikanaga

backport r41871.

#3 Updated by Tomoyuki Chikanaga 10 months ago

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

#4 Updated by Tomoyuki Chikanaga 9 months 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