-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
The time package does not support leap seconds. This is further explored in these two issues:
#15190
#8728
While it looks like this won't be fixed until Go 2.0, we can at least document the current behavior. Specifically the following things should be documented:
- The definition of a "second". Specifically, it should be clarified that go uses the "POSIX-second". A POSIX-second is equal to one standard second in all cases except when a POSIX-second is followed by a leap-second, in which case the POSIX-second is equal to two standard seconds, and the leap-second is skipped. This means that when calculating the Duration between two dates as a number of seconds, the unit being calculated is POSIX-seconds. To convert to standard seconds, add the number of leap seconds that occurred between the two dates in question.
- The
timepackage does not support parsing datetimes that contain a leapsecond. For example, the package will not parse2005-12-31T23:59:60Z. - The behavior of
time.Sleepis unaffected and uses standard seconds in all cases, since it uses a monotonic clock provided by theruntimepackage. (As far as I can figure it, this needs to be confirmed) - The behavior of the above items on non-POSIX systems (like windows)
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.