cploutarchou
2/5/2020 - 3:34 PM

Get Today Date Javascript

Get Today Date Javascript

var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();

today = yyyy + '-' + mm + '-' + dd;
alert(today);