title: How do you convert a time offset to a location/timezone in Go
body: <p>Given an arbitrary time offset, how does one go about creating a usable <code>time.Location</code> object that represents that time offset?</p>
  
  <p>The following <a href="https://play.golang.org/p/j_E28qJ8Vgy" rel="noreferrer">code</a> parses a time using an offset, but <code>fmt.Println(t.Location())</code> subsequently returns no information:</p>
  
  <pre><code>func main() {
      offset := "+1100"
  
      t, err := time.Parse("15:04 GMT-0700","15:06 GMT"+offset)
      if err != nil {
          fmt.Println("fail", err)
      }
      fmt.Println(t)
      fmt.Println(t.UTC())
      fmt.Println(t.Location())
  }
  </code></pre>
  
  <p>Playground: <a href="https://play.golang.org/p/j_E28qJ8Vgy" rel="noreferrer">https://play.golang.org/p/j_E28qJ8Vgy</a></p>
  
  <p>Basically I have some time data with time offsets, but without location data, I want to create a <code>time.Location</code> object to ensure the GMT offset is recorded. And then be able to output the time relative to the end users actual location time offset.</p>