This documentation is archived and is not being maintained.

getUTCDate Method

Returns the date in a Date object using Coordinated Universal Time (UTC).

function getUTCDate() : Number


To get the date using local time, use the getDate method.

The return value is an integer between 1 and 31 that represents the date value in the Date object.


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();


Version 3

See Also

getDate Method | setDate Method | setUTCDate Method

Applies To: Date Object