mirror of
https://github.com/golang/go
synced 2024-11-19 16:54:44 -07:00
time: add example for FixedZone
Change-Id: I8a6c3e225038cbeb315433fabf8835f582836d3e Reviewed-on: https://go-review.googlesource.com/93657 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
1091b50cc0
commit
0ed5bec951
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user