horodatage js
var timestamp = new Date().getTime();
GutoTrosla
var timestamp = new Date().getTime();
Math.round(new Date().getTime() / 1000).toString()
var timestamp = 1607110465663
var date = new Date(timestamp);
console.log(date.getTime())
console.log(date)
var currentTimeInSeconds=Math.floor(Date.now()/1000); //unix timestamp in seconds
var currentTimeInMilliseconds=Date.now(); // unix timestamp in milliseconds
// human date --> timestamp
function toTimestamp(strDate){
var datum = Date.parse(strDate);
return datum/1000;
}
alert(toTimestamp('02/13/2009 23:31:30'));
const toTimestamp=(strDate)=>{
var datum = Date.parse(strDate);
return datum/1000;
}
console.log(toTimestamp('02/13/2009 23:31:30'));