From 8af5f970dc83d26855af0df8cedffc3e30073106 Mon Sep 17 00:00:00 2001 From: zeus Date: Wed, 18 Nov 2020 01:02:29 +0200 Subject: [PATCH] add --- swarmlab-app/src/run/app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 8058256..887cd8c 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -99,6 +99,11 @@ async function checkToken(token) { } } + +function convertDateToUTC(date) { +return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); +} + // *************************************************** // rest get // *************************************************** @@ -148,7 +153,9 @@ cors(corsOptions), (req, res, next) => { n.minutes = now.getMinutes(); n.seconds = now.getSeconds(); n.milliseconds = now.getMilliseconds(); - reslog.date = n + //reslog.date = n + + reslog.date = convertDateToUTC(now) console.log(reslog); io.emit("logdata", reslog);