Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

getDate Method (JavaScript)

Returns the day-of-the-month value in a Date object using local time.


The required dateObj reference is a Date object.

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

The return value is an integer between 1 and 31 that represents the day-of-the-month value in the Date object.

The following example illustrates the use of the getDate method.

function DateDemo(){
   var d;
   var s = "Today's date is: ";
   d = new Date();
   s += (d.getMonth() + 1) + "/";
   s += d.getDate() + "/";
   s += d.getFullYear();

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information.

Applies To: Date Object (JavaScript)

© 2015 Microsoft