Return the day of the month:
The result of n will be:
The getDate() method returns the day of the month (from 1 to 31) for the specified date.
![]()
The getDate() method is supported in all major browsers.
| Type | Description |
|---|---|
| Number | A number from 1 to 31, representing the day of the month |
| JavaScript Version: | 1.1 |
|---|
Return the day of the month from a specific date:
The output of the code above will be:
JavaScript Date Object
Your message has been sent to W3Schools.