getDate()
Date
instance method
JS Home <<
JS Reference <<
Date <<
getDate()
Description
Returns the locale specific day of the month (1-31) for the specified date.
Syntax
Signature | Description |
---|---|
aDate.getDate() | Returns the locale specific day of the month (1-31) for the specified date. |
Parameters
None.
Examples
The code below shows an example of the getDate()
method of Date
.
// Create a Date instance for the current date and time.
var todaysDate = new Date();
alert(todaysDate);
// Get Day of the month.
alert(todaysDate.getDate());
Related Tutorials
JavaScript Intermediate Tutorials - Lesson 2 - Dates and Times