Skip to content

Commit

Permalink
time: document the Time.String is meant for debugging
Browse files Browse the repository at this point in the history
Fixes #20876

Change-Id: Ic62c4f59e3ddcae891aa9526f9693d233dd524fc
Reviewed-on: https://go-review.googlesource.com/47552
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
  • Loading branch information
bradfitz committed Jul 6, 2017
1 parent e335643 commit 4e2eff4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/time/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@ func formatNano(b []byte, nanosec uint, n int, trim bool) []byte {
// If the time has a monotonic clock reading, the returned string
// includes a final field "m=±<value>", where value is the monotonic
// clock reading formatted as a decimal number of seconds.
//
// The returned string is meant for debugging; for a stable serialized
// representation, use t.MarshalText, t.MarshalBinary, or t.Format
// with an explicit format string.
func (t Time) String() string {
s := t.Format("2006-01-02 15:04:05.999999999 -0700 MST")

Expand Down

0 comments on commit 4e2eff4

Please sign in to comment.