幕布斯7119047
这似乎做到了:package mainimport ( "fmt" "time")func zone(s string, d time.Duration) *time.Location { f := d.Seconds() return time.FixedZone(s, int(f))}func main() { z := zone("GMT-4", -240 * time.Minute) t := time.Date(2021, 3, 30, 19, 22, 53, 0, z) fmt.Println(t) // 2021-03-30 19:22:53 -0400 GMT-4}https://golang.org/pkg/time#FixedZone