mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 03:16:22 -05:00
Removing timezone offset from elapsed.
This commit is contained in:
parent
81504f4ac8
commit
af115e9731
1 changed files with 2 additions and 4 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue