-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Description
go version: go version go1.17.5 linux/amd64
RFC3339 documents that leap seconds will be denoted as YYYY-MM-DDT23:59:60Z. Attempting to parse such a value using time.Parse returns the following error:
parsing time "2022-12-31T23:59:60Z": second out of range
https://go.dev/play/p/es_oGD37vZl
This behavior seems perfectly reasonable, given the fact that Go's time keeping does not account for the leap second and instead uses the Unix style of time. However, while I notice that the documentation for package time mentions that calendrical calculations always assume a Gregorian calendar, with no leap seconds, it doesn't seem to indicate the parser behavior.
I see that issues have been opened in the past to change the behavior, #8728. This issue is just a request that the behavior be documented as part of the time package.
Happy to provide any other information needed.