How can I convert seconds into a datetime object in javascript.
Examples:
1.3308313703571
1.6324722385401
This is from a series of points and when they occurred. I understand 1.23323 more then seconds, but I can not change the value, being pulled from an api.
You can try like this:
function toDateTime(secs) { var t = new Date(1970, 0, 1); // Epoch t.setSeconds(secs); return t; }
Info on epoch date.
2.1m questions
2.1m answers
60 comments
57.0k users