Share via


getUTCDate Method

Returns the day of the month in a Date object using Coordinated Universal Time (UTC).

function getUTCDate() : Number

Remarks

To get the day of the month in local time, use the getDate method.

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

Example

The following example illustrates the use of the getUTCDate method.

function UTCDateDemo(){
   var d, s = "Today's UTC date is: ";
   d = new Date();
   s += (d.getUTCMonth() + 1) + "/";
   s += d.getUTCDate() + "/";
   s += d.getUTCFullYear();
   return(s);
}

Requirements

Version 3

Applies To:

Date Object

See Also

Reference

getDate Method

setDate Method

setUTCDate Method

Change History

Date

History

Reason

March 2009

Clarified introduction and Remarks section.

Information enhancement.