FixedZone in Go

Posted by GoDoc
Public (Editable by Users)

FixedZone returns a Location that always uses the given zone name and offset (seconds east of UTC).

Go
Edit
package main

import (
	"fmt"
	"time"
)

func main() {
	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))
}