Commit 0ed5bec9 authored by Kevin Burke's avatar Kevin Burke Committed by Brad Fitzpatrick

time: add example for FixedZone

Change-Id: I8a6c3e225038cbeb315433fabf8835f582836d3e
Reviewed-on: https://go-review.googlesource.com/93657Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 1091b50c
......@@ -598,3 +598,10 @@ func ExampleTime_AppendFormat() {
// Output:
// Time: 11:00AM
}
func ExampleFixedZone() {
loc := time.FixedZone("UTC-8", -8*60*60)
t := time.Date(2009, time.November, 10, 23, 0, 0, 0, loc)
fmt.Println("The time is:", t.Format(time.RFC822))
// Output: The time is: 10 Nov 09 23:00 UTC-8
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment