Is there a clean way of adding a 0 in front of the day or month when the day or month is less than 10:
var myDate = new Date(); var prettyDate =(myDate.getFu
You can try like this
For day:
("0" + new Date().getDate()).slice(-2)
For month:
("0" + (new Date().getMonth() + 1)).slice(-2)
For year:
new Date().getFullYear();