Clean up datetime output and code

* For clarity, add `UTC` suffix for datetimes in the `Diagnostics` admin tab.
* Format datetimes in the local timezone in the `Users` admin tab.
* Refactor some datetime code and add doc comments.
This commit is contained in:
Jeremy Lin
2020-12-11 22:47:54 -08:00
parent 219a9d9f5e
commit 455a23361f
4 changed files with 42 additions and 29 deletions

View File

@@ -72,7 +72,7 @@
const hour = String(d.getUTCHours()).padStart(2, '0');
const minute = String(d.getUTCMinutes()).padStart(2, '0');
const seconds = String(d.getUTCSeconds()).padStart(2, '0');
const browserUTC = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + seconds;
const browserUTC = `${year}-${month}-${day} ${hour}:${minute}:${seconds} UTC`;
document.getElementById("time-browser-string").innerText = browserUTC;
const serverUTC = document.getElementById("time-server-string").innerText;
@@ -147,4 +147,4 @@
}
}
})();
</script>
</script>