Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
getDate Method (Date)

getDate Method (Date) (JavaScript)

Gets the day-of-the-month, using local time.


The required dateObj reference is a Date object.

An integer between 1 and 31 that represents the day-of-the-month.

To get the day-of-the-month using Universal Coordinated Time (UTC), use the getUTCDate method.

The following example illustrates the use of the getDate method.

var date = new Date("Jan 01, 2001");
var str = "Today's date is: ";
   str += (date.getMonth() + 1) + "/";
   str += date.getDate() + "/";
   str += date.getFullYear();

// Output: Today's date is: 1/1/2001

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Applies To: Date Object (JavaScript)

© 2015 Microsoft