getDate()
JavaScript Date getDate() method
Last Updated : 17 Mar 2025
The JavaScript date getDate() method returns the day for the specified date on the basis of local time.
Syntax
The getDate() method is represented by the following syntax:
Return
An integer value between 1 and 31 that represents the day of the specified date.
JavaScript Date getDate() method example
Here, we will understand getDate() method through various examples.
Example 1
Let's see an example to print today's date.
Output:
Example 2
Let's see an example to print the day from the given date.
Output: