From af115e973173933b91940fccd9acab6ec7c95040 Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 3 Jan 2023 12:35:27 -0700 Subject: [PATCH] Removing timezone offset from elapsed. --- app/src/components/Common.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/components/Common.js b/app/src/components/Common.js index 4b4df586..effdf187 100644 --- a/app/src/components/Common.js +++ b/app/src/components/Common.js @@ -42,8 +42,7 @@ export function secondsElapsed(seconds) { } // Get seconds elapsed between now and `seconds` which is a UTC epoch. - const now = new Date(); - const localNow = now.getTime() - (now.getTimezoneOffset() * 60000); + const localNow = (new Date()).getTime(); let years; let days; @@ -210,8 +209,7 @@ export function secondsToDate(seconds) { } export function secondsToTimestamp(seconds) { - const offset = (new Date()).getTimezoneOffset() * 60000; - let d = new Date((seconds * 1000) + offset); + let d = new Date(seconds * 1000); const month = String(d.getMonth() + 1).padStart(2, '0'); const day = String(d.getDate()).padStart(2, '0'); const hours = String(d.getHours()).padStart(2, '0');