Bug #12825
closed
Time.parse doesn't work when using T as time delimiter and only hours are specified
Added by webpapaya (Thomas Mayrhofer) about 9 years ago.
Updated about 9 years ago.
Description
When using the T delimiter instead of \s the hour isn't parsed correctly.
require 'time'
Time.parse('2000-01-01T10') # => 2000-01-01 00:00:00 +0100
Time.parse('2000-01-01 10') # => 2000-01-01 10:00:00 +0100
When the minutes are defined everything works as expected.
- Status changed from Open to Rejected
Thomas Mayrhofer wrote:
When using the T delimiter instead of \s the hour isn't parsed correctly.
require 'time'
Time.parse('2000-01-01T10') # => 2000-01-01 00:00:00 +0100
Time.parse('2000-01-01 10') # => 2000-01-01 10:00:00 +0100
'T' is used by ISO-8601, but the former is invalid for it and that part is ignored.
In the latter case, a word "10" is fallen back to hour.
When the minutes are defined everything works as expected.
Ditto.
Also available in: Atom
PDF
Like0
Like0