Javatpoint Logo
Javatpoint Logo

JavaScript Date getDate() method

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.

Test it Now

Output:

Today's day: 16

Example 2

Let's see an example to print the day from the given date.

Test it Now

Output:

15

Next TopicJavaScript Math





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA