-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Description
-
What version of Go are you using (
go version)?$ go version go version devel +2d823fd Tue Oct 13 01:04:42 2015 +0000 linux/amd64 -
What operating system and processor architecture are you using?
linux/amd64
-
What did you do?
Attempted to parse this time:
"618 AM MDT TUE OCT 13 2015"with this format string:"304 PM MST Mon Jan 02 2006" -
What did you expect to see?
No parsing error, and a time.Time representing that moment.
-
What did you see instead?
The parsing fails, and the error reported:
parsing time "618 AM MDT TUE OCT 13 2015": hour out of range. The hour is interpreted as61.The format works properly with a two digit hour. It seems
getnum()in time/format.go takes up to two characters whenever the second character is valid which leads to the issue. -
Playground example with examples that fail and pass for the given format:
Apologies if my code is messy...
The format is used as a time/version stamp for the US National Weather Service in their forecast discussion products, for a real world example, http://www.wrh.noaa.gov/total_forecast/getprod.php?wfo=boi&pil=AFD&sid=BOI&version=1
Thank you.