I'm having a very strange issue whereby getting the time value from my HTTP POST req in express always result in NaN if I'm trying to convert it to ISO String or even Date object.
Here is my URL request: http://localhost:3000/sensor/reading/update?value=33.5&time=1430217238000
update.js
var express = require('express');
var router = express.Router();
var moment = require('moment');
router.post('/', function(req, res, next) {
var time = moment(req.query.time);
}
I am sure that the req.query.time is valid since I can see the exact value in console.log(req.query.time). Even var time = new Date(req.query.time) also result in invalid date.
Totally lost of thoughts here :(
new Date("1430217238000")is in fact not a valid date