How can I extract the value of my current local time offset?

You can use the Zone() method on the time type:

package main

import (
    "fmt"
    "time"
)

func main() {
    t := time.Now()
    zone, offset := t.Zone()
    fmt.Println(zone, offset)
}

Zone computes the time zone in effect at time t, returning the abbreviated name of the zone (such as “CET”) and its offset in seconds east of UTC.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)