Survol des dates en JS

Avec new Date() let today = new Date()// 2020-12-22T08:26:17.725Z today.toLocaleString()// ’22/12/2020 à 09:26:17′ today.toUTCString()// ‘Tue, 22 Dec 2020 08:26:17 GMT’ Timestamp let timestamp = Date.now()// 1608626048418 let timestampToDate = new Date(timestamp)// 2020-12-22T08:34:08.418Z let aDate = “Tue, 22 December 2020 09:40:00 +0000”;let aDateToNewDate = new Date(aDate)// 2020-12-22T09:40:00.000Z aDateToNewDate.getTime()// 1608630000000new Date(1608630000000)// 2020-12-22T09:40:00.000Z

Lire la suite