getDate()

ES1+

Returns the day of the month (1-31) for the specified date according to local time.

Syntax

date.getDate()

Return Value

number

A number (1-31) representing the day of the month

Examples

JavaScript
const date = new Date('2024-03-15');
console.log(date.getDate());
Output:
// 15

Related Methods