1var timestamp = 1607110465663
2var date = new Date(timestamp);
3console.log(date.getTime())
4console.log(date)
1var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
2var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds
1// human date --> timestamp
2
3function toTimestamp(strDate){
4 var datum = Date.parse(strDate);
5 return datum/1000;
6}
7alert(toTimestamp('02/13/2009 23:31:30'));
1const toTimestamp=(strDate)=>{
2 var datum = Date.parse(strDate);
3 return datum/1000;
4}
5console.log(toTimestamp('02/13/2009 23:31:30'));