Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

getDate Method (Date) (JavaScript)

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

dateObj.getDate() 

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();
document.write(str);

// 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)

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.