title: Convert UTC to "local" time in Go
body: <p>How can I convert UTC time to <em>local time</em>?</p>
  
  <p>I've created a map with the UTC difference for all the countries I need the local time. Then I add that difference as duration to the current time (UTC) and print the result hoping that's the local time of that specific country.</p>
  
  <p>For some reasons the result is wrong. For example with <a href="http://www.timeanddate.com/worldclock/hungary/budapest" rel="noreferrer">Hungary</a> there is one hour difference. Any idea why I'm getting incorrect results?</p>
  
  <pre><code>package main
  
  import "fmt"
  import "time"
  
  func main() {
  
      m := make(map[string]string)
      m["Hungary"] = "+01.00h"
  
      offSet, err := time.ParseDuration(m["Hungary"])
      if err != nil {
          panic(err)
      }
      t := time.Now().UTC().Add(offSet)
      nice := t.Format("15:04")
  
      fmt.Println(nice)
  }
  </code></pre>