From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Date Object
The getDate() method returns the day of the month.
| dateObject.getDate() |
Note: The value returned by getDate() is a number between 1 and 31.
Note: This method is always used in conjunction with a Date object.
Example 1Print the day of the current month:
The output of the code above will be: Try it yourself » |
Example 2Print the day of the month in a specific date:
The output of the code above will be:
Try it yourself » |
More Examples |
Display the current date in different formats
How to use getDate(), getMonth(), and getFullYear() to display the current date in different formats.
JavaScript Date Object
From http://www.w3schools.com (Copyright Refsnes Data)