Actions
Bug #18565
closedstrptime reports invalid date when string is "130AM" and format string is '%I:%M%p'
Description
DateTime.strptime("1:30PM", '%I:%M%p')
and DateTime.strptime("1:30PM", '%l:%M%p')
both return
#<DateTime: 2022-02-01T13:30:00+00:00 ((2459612j,48600s,0n),+0s,2299161j)>
DateTime.strptime("130PM", '%I%M%p')
and DateTime.strptime("130PM", '%l%M%p')
both raise the exception Date::Error: invalid date
I don't understand why an exception should be raised when the string is "130PM"
. Is this a bug?
Actions
Like0
Like0