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
| Chrome | yes |
| Edge | yes |
| Firefox | 1 |
| Internet Explorer | yes |
| Opera | yes |
| Safari | yes |
| Android webview | yes |
| Chrome for Android | yes |
| Edge mobile | yes |
| Firefox for Android | 4 |
| Opera Android | yes |
Leave a comment