Javascript Date getDate()
returns the day of the month (1 through 31) for the date.
Item | Description |
---|---|
Example usage | dateObj.getDate() |
Return value | An integer number, between 1 and 31. It represents the day of the month for the given date in local time. |
let d = new Date(); let n = d.getDate(); console.log(n);//from ww w . j a v a 2 s . c o m d = new Date('December 25, 2020 23:15:30'); var day = d.getDate(); console.log(day); // 25