How can I extract the value of my current local time offset?
<p>I'm struggling a bit trying to format and display some IBM mainframe TOD clock data. I want to format the data in both GMT and local time (as the default -- otherwise in the zone the user specifies).</p>
<p>For this, I need to get the value of the local time offset from GMT as a signed integer number of seconds.</p>
<p>In zoneinfo.go (which I confess I don't fully understand), I can see</p>
<pre><code>// A zone represents a single time zone such as CEST or CET.
type zone struct {
    name   string // abbreviated name, &quot;CET&quot;
    offset int    // seconds east of UTC
    isDST  bool   // is this zone Daylight Savings Time?
}
</code></pre>
<p>but this is not, I think, exported, so this code doesn't work:</p>
<pre><code>package main
import ( &quot;time&quot;; &quot;fmt&quot; )

func main() {
    l, _ := time.LoadLocation(&quot;Local&quot;)
    fmt.Printf(&quot;%v\n&quot;, l.zone.offset)
}
</code></pre>
<p>Is there a simple way to get this information?</p>