Home » JavaScript Date getDate() Method

JavaScript Date getDate() Method

by Online Tutorials Library

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

You may also like