1const unixTime = 1210981217;
2const date = new Date(unixTime*1000);
3console.log(date.toLocaleDateString("en-US"));
4//expected: "5/16/2008"
1var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
2var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds