changed timestamp to UTC in ESP only, local timezone is calculated by browser thx @homeautomation22

This commit is contained in:
lumapu 2022-10-22 00:09:26 +02:00
parent 6ed2dfde9c
commit 72219cdf17
5 changed files with 37 additions and 55 deletions

View file

@ -106,7 +106,7 @@
+ ("0"+sec).substr(-2);
var dSpan = document.getElementById("date")
if(0 != obj["ts_now"])
dSpan.innerHTML = date.toLocaleString('de-DE', {timeZone: 'UTC'});
dSpan.innerHTML = date.toLocaleString('de-DE');
else {
var e = inp("set", "sync from browser", 0, ["btn"], "set", "button");
dSpan.appendChild(span("NTP timeserver unreachable. "));
@ -114,8 +114,8 @@
dSpan.appendChild(span("", ["span"], "apiResult"));
e.addEventListener("click", setTime);
}
document.getElementById("sunrise").innerHTML = sunrise.toLocaleString('de-DE', {timeZone: 'UTC'});
document.getElementById("sunset").innerHTML = sunset.toLocaleString('de-DE', {timeZone: 'UTC'});
document.getElementById("sunrise").innerHTML = sunrise.toLocaleString('de-DE');
document.getElementById("sunset").innerHTML = sunset.toLocaleString('de-DE');
if(!obj["ts_sun_upd"]) {
var elem = document.getElementById("sun");
@ -145,7 +145,7 @@
if(false == i["is_avail"]) {
if(i["ts_last_success"] > 0) {
var date = new Date(i["ts_last_success"] * 1000);
html += "-> last successful transmission: " + date.toLocaleString('de-DE', {timeZone: 'UTC'});
html += "-> last successful transmission: " + date.toLocaleString('de-DE');
}
}