]> Cypherpunks repositories - gostls13.git/commit
time: add Round and Truncate
authorRuss Cox <rsc@golang.org>
Sun, 9 Dec 2012 08:59:33 +0000 (03:59 -0500)
committerRuss Cox <rsc@golang.org>
Sun, 9 Dec 2012 08:59:33 +0000 (03:59 -0500)
commit00cd6a3be31cd685c15fff1d7b8b62b286cc95f6
tree17a44ea4e881095314e401c33732d9b406ba7f21
parent561edbd63ceb0b1c0177051a0c151c68278219d6
time: add Round and Truncate

New in Go 1 will be nanosecond precision in the result of time.Now on Linux.
This will break code that stores time in external formats at microsecond
precision, reads it back, and expects to get exactly the same time.

Code like that can be fixed by using time.Now().Round(time.Microsecond)
instead of time.Now() in those contexts.

R=golang-dev, bradfitz, iant, remyoudompheng
CC=golang-dev
https://golang.org/cl/6903050
doc/go1.1.html
src/pkg/time/example_test.go
src/pkg/time/time.go
src/pkg/time/time_test.go