The getDate() method returns the day of the month (from 1 to 31) for the date object.
The getDate() method returns the day of the month (from 1 to 31) for the date object.
Date.getDate()
None |
---|
A Number, from 1 to 31, representing the day of the month
Return the day of the month:
//display todays day of the month. var d = new Date(); var n = d.getDate(); console.log(n);/* w ww . j a v a 2s . co m*/ //Return the day of the month from a specific date: var d = new Date("July 21, 2010 01:15:00"); var n = d.getDate() console.log(n);