You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation should mention that the example for http://golang.org/pkg/time/#Time.Format prints the same value for t.Format() and t.UTC().Format(). Reader may assume Format() always prints UTC. I think it behaves that way only because play.golang.org server runs in UTC. May be you should do one of
set play.golang.org to a different timezone because UTC is so special (for the rest of the world)
or document this near / inside the example.
or change the example to use a different timezone instead of time.Local
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
Minor documentation correction for pkg/time/#Time.Format
time: Minor documentation correction for pkg/time/#Time.Format
Jun 12, 2015
Interesting point. The example is clear enough, and if you run it yourself the expected thing will happen, but if you run it by clicking on the button on golang.org it will indeed always print in UTC.
I guess my vote is to expand the comment in the example to mention what happens on golang.org.
The documentation should mention that the example for http://golang.org/pkg/time/#Time.Format prints the same value for t.Format() and t.UTC().Format(). Reader may assume Format() always prints UTC. I think it behaves that way only because play.golang.org server runs in UTC. May be you should do one of
The text was updated successfully, but these errors were encountered: