Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
time: Year overflow for time.Date #5923
What steps will reproduce the problem? // Get the value of time.Unix(-0x7FFFFFFBF5184BFB, -0x8000000000000000).Year() // good -292277022399 // and compare it to the one just below time.Unix(-0x7FFFFFFBF5184BFC, -0x8000000000000000).Year() // bad 292277026854 You can play with it here : http://play.golang.org/p/SnAdKtD-_y What is the expected output? Year should be in the same order as the timestamp What do you see instead? Year overflows Which compiler are you using (5g, 6g, 8g, gccgo)? gc/bin/go tool 6g Which operating system are you using? Linux 64bits Which version are you using? (run 'go version') go version go1.1.1 linux/amd64 Please provide any additional information below. It might be completely minor but I could imagine some security issues in validation functions checking if the year of a given date is in the past.