I have files with epoch time stamps such as 1564002293050
. Using https://www.epochconverter.com/ this shows Wednesday, July 24, 2019 9:04:53.050 PM
however my code shows Mon Apr 06 51531 02:24:10 GMT-0700 (Pacific Daylight Time)
. Why is this?
Because the times were generated in Unix, I multiplied by 1000 for ms. This value is then displayed.
time = 1564002293050;
var dateStamp = new Date(time* 1000);
Edit:
Ive referenced this post and several similar others. It is good to note that not multiplying it by 1000 will result with "Invalid Date"
.
Edit 2:
Figure it out. I was parsing the data but looks like I had to convert it to an integer parseInt(time)
ended up fixing the issue. Sorry for the unrelated solution..