8000 time: Sub doesn't respect leap seconds · Issue #15190 · golang/go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
time: Sub doesn't respect leap seconds #15190
Closed
@phayes

Description

@phayes
  1. What version of Go are you using (go version)?
    go1.6 (playground)
  2. What operating system and processor architecture are you using (go env)?
    nacl (playground)
  3. What did you do?
    https://play.golang.org/p/qZ-RocY8nm
  4. What did you expect to see?
    Output should be:
    1s
    2s
  5. What did you see instead?
    1s
    1s

When calculating a Duration that crosses a leap second, go reports an incorrect duration. Note that in the playground example we are parsing UTC time and the UTC standard requires adherence to leap seconds.

This also means that the definition of the zero value of time.Time is incorrect.

The documentation states: "The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC". This is incorrect.

The zero value of time.Time is actually January 1, year 1, 00:00:26.000000000 UTC

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0