csv with local time
This commit is contained in:
parent
37d1d35afa
commit
3499f939f9
|
|
@ -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])
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue