diff --git a/metrics.go b/metrics.go index d663291..092aef0 100644 --- a/metrics.go +++ b/metrics.go @@ -305,6 +305,7 @@ func downloadmetricsHandler(response http.ResponseWriter, request *http.Request) log.Fatal("Error reading body. ", err) } fmt.Println("response Body:", string(body)) + location, err := time.LoadLocation("Europe/Zurich") scanner := bufio.NewScanner(strings.NewReader(string(body))) @@ -317,7 +318,7 @@ func downloadmetricsHandler(response http.ResponseWriter, request *http.Request) fmt.Printf("error converting time: %s\n", s[3]) continue } - mytime := t.Format("02.01.2006 15:04") + mytime := t.In(location).Format("02.01.2006 15:04") fmt.Fprintf(response, "\"%s\",%s,%s\n", mytime, s[8], s[9]) }