diff --git a/controllers/viewTemp.go b/controllers/viewTemp.go index 8381042..4f833e4 100644 --- a/controllers/viewTemp.go +++ b/controllers/viewTemp.go @@ -8,6 +8,11 @@ import ( "html/template" "strconv" + "time" +) + +var ( + _, timezoneOffset = time.Now().Zone() ) type ViewTempController struct { @@ -49,7 +54,7 @@ func formatDataSensor(sensorName string, values []temperature.TempTable) string if i > 0 { ret += "," } - horodate := strconv.FormatInt(values[i].HorodateGMT.Unix() * 1000, 10) + horodate := strconv.FormatInt((values[i].HorodateGMT.Unix()+int64(timezoneOffset)) * 1000, 10) value := strconv.FormatInt(values[i].Value, 10) ret += "["+horodate+","+value+"]" } diff --git a/views/temp.tpl b/views/temp.tpl index b59fa3c..918daca 100644 --- a/views/temp.tpl +++ b/views/temp.tpl @@ -58,8 +58,7 @@ }); Highcharts.setOptions({ global: { - useUTC: true, - timezoneOffset: -4 * 60 + useUTC: false } });