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.