pmarcinkiew / iotjs

Platform for Internet of Things with JavaScript http://www.iotjs.net
Other
0 stars 1 forks source link

Date.now() returns wrong timestamp format #149

Open tosyu opened 6 years ago

tosyu commented 6 years ago

I need a integer not a float

console.log(Date.now());
nodejs ./test.js
// 1512038441990
iotjs ./test.js
// 1512038438274.954

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now

A Number representing the milliseconds elapsed since the UNIX epoch.

https://ecma-international.org/ecma-262/5.1/#sec-15.9

The now function return a Number value that is the time value designating the UTC date and time of the occurrence of the call to now.

https://ecma-international.org/ecma-262/5.1/#sec-15.9.1.1