The getDate()
method returns the day of a date as a number (1-31):
Example
const d = new Date();
document.getElementById("demo").innerHTML = d.getDate();
document.getElementById("demo").innerHTML = d.getDate();
Practice Excercise Practice now
The getDate()
method returns the day of a date as a number (1-31):
Practice Excercise Practice now