JavaScript Date.getDate()

Why getDate ?

The JavaScript GetDate () method returns the day value of the specified date.

Syntax:

Date.getDate()

This function does not takes any parameter. It is just used along with a Date Object from which we want to fetch date of the month.

Return: Returns today’s date and time.


JavaScript getDate Examples

Example 1

        var date = new Date("February 04, 2019 13:30:00");
        console.log("Date.getDate() : " + date.getDate());

output:

4


Example 2

        let date = new Date();
        let now = date.getDate();
        console.log(now)

output:

5


Browser Support

Chromeyes
Edgeyes
Firefox1
Internet Exploreryes
Operayes
Safariyes
Android webviewyes
Chrome for Androidyes
Edge mobileyes
Firefox for Android4
Opera Androidyes

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑

Design a site like this with WordPress.com
Get started