From 9484d803870440e5c63895e0f17739cd99891e93 Mon Sep 17 00:00:00 2001 From: zorruno Date: Thu, 26 Jan 2023 13:43:43 +1300 Subject: [PATCH] update date to be global --- notificationnode.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/notificationnode.js b/notificationnode.js index ccc9be9..878fb6c 100644 --- a/notificationnode.js +++ b/notificationnode.js @@ -26,6 +26,14 @@ function epochToFormattedTime(d) { return h + ':' + m.substr(-2); } +// Function to convert unix epoch to 00:00 +function epochToFormattedTime(d) { + d = new Date(d * 1000); + var h = d.getHours(); + var m = "0" + d.getMinutes(); + return h + ':' + m.substr(-2); +} + // Extract start/stop time based on the unix timestamp // First multiply by 1000 so that the argument is in milliseconds, not seconds.