From 84ab9a7fedfb92231ba9078c6765418d69ad1836 Mon Sep 17 00:00:00 2001 From: zeus Date: Thu, 19 Nov 2020 01:33:46 +0200 Subject: [PATCH] add milliseconds --- swarmlab-app/src/run/app.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 887cd8c..ac82b8a 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -101,7 +101,7 @@ async function checkToken(token) { function convertDateToUTC(date) { -return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()); +return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(),date.getUTCMilliseconds()); } // *************************************************** @@ -141,18 +141,19 @@ cors(corsOptions), (req, res, next) => { for (var i = 0; i < req.body.length; i++){ var obj = req.body[i]; + var now = new Date(); + var reslog = new Object(); reslog.log = obj - var now = new Date(); - var n = {} - n.year = now.getFullYear(); - n.month = now.getMonth(); - n.day = now.getDay(); - n.hours = now.getHours(); - n.minutes = now.getMinutes(); - n.seconds = now.getSeconds(); - n.milliseconds = now.getMilliseconds(); + //var n = {} + //n.year = now.getFullYear(); + //n.month = now.getMonth(); + //n.day = now.getDay(); + //n.hours = now.getHours(); + //n.minutes = now.getMinutes(); + //n.seconds = now.getSeconds(); + //n.milliseconds = now.getMilliseconds(); //reslog.date = n reslog.date = convertDateToUTC(now)