-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
UnixNano gives inconsistent results. Specifically, it believes the year 1 comes after the year 1720.
package main
import (
"fmt"
"time"
)
func main() {
t1 := time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC)
t2 := time.Date(1720, 12, 30, 0, 0, 0, 0, time.UTC)
t3 := time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC)
fmt.Printf("%s: %d\n", t1, t1.UnixNano())
fmt.Printf("%s: %d\n", t2, t2.UnixNano())
fmt.Printf("%s: %d\n", t3, t3.UnixNano())
}
0001-01-01 00:00:00 +0000 UTC: -6795364578871345152
1720-12-30 00:00:00 +0000 UTC: -7857820800000000000
1970-01-01 00:00:00 +0000 UTC: 0
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.