Browse Source

add milliseconds

master
zeus 4 years ago
parent
commit
84ab9a7fed
  1. 21
      swarmlab-app/src/run/app.js

21
swarmlab-app/src/run/app.js

@ -101,7 +101,7 @@ async function checkToken(token) {
function convertDateToUTC(date) { 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++){ for (var i = 0; i < req.body.length; i++){
var obj = req.body[i]; var obj = req.body[i];
var now = new Date();
var reslog = new Object(); var reslog = new Object();
reslog.log = obj reslog.log = obj
var now = new Date(); //var n = {}
var n = {} //n.year = now.getFullYear();
n.year = now.getFullYear(); //n.month = now.getMonth();
n.month = now.getMonth(); //n.day = now.getDay();
n.day = now.getDay(); //n.hours = now.getHours();
n.hours = now.getHours(); //n.minutes = now.getMinutes();
n.minutes = now.getMinutes(); //n.seconds = now.getSeconds();
n.seconds = now.getSeconds(); //n.milliseconds = now.getMilliseconds();
n.milliseconds = now.getMilliseconds();
//reslog.date = n //reslog.date = n
reslog.date = convertDateToUTC(now) reslog.date = convertDateToUTC(now)

Loading…
Cancel
Save