Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript getUTCDate() Method

JavaScript getUTCDate() Method

Date Object Reference JavaScript Date object

Example

Return the day of the month (UTC) based on universal time:

var d = new Date();

var n = d.getUTCDate();

n Output result:

Try it »


Definition and Usage

The getUTCDate() method returns the day of the month (UTC) based on universal time.

Coordinated Universal Time (UTC) is a time measurement system based on the atomic second, designed to stay as close as possible to universal time.

**Tip:** Coordinated Universal Time, also known as Universal Time, World Standard Time, or International Coordinated Time, abbreviated as UTC (Universal Coordinated Time).

**Note:** UTC time is the same as GMT (Greenwich) time.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the getUTCDate() method.


Syntax

Date

.getUTCDate()

Return Value

Type Description
Number Returns the day of the month (a value between 1 and 31).

Technical Details

JavaScript version: 1.3

More examples

Example

Here we define a variable with a specific date, then output the day of the month from the variable according to UTC:

var d = new Date("July 21, 1983 01:15:00");

var n = d.getUTCDate();

n Output result:

Try it »


Date Object Reference JavaScript Date object