Actions
Backport #8608
closedInconsistent parse of DateTime zone specification with seconds
Status:
Closed
Assignee:
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') # => #<DateTime: 1973-11-06T18:45:00+03:00 ((2441993j,56700s,0n),+10800s,2299161j)>
This defect is not present when the hour is specified by two digits:
DateTime.parse('7 Nov 1973 04:00 +124500') # => #<DateTime: 1973-11-07T04:00:00+12:45 ((2441993j,54900s,0n),+45900s,2299161j)>
Attached is a patch which corrects this issue.
Files
Actions
Like0
Like0Like0Like0Like0