Javascript - Date getUTCDate() Method

The getUTCDate() method returns the day of the month ranged from 1 to 31 from the date object, according to universal time.

Description

The getUTCDate() method returns the day of the month ranged from 1 to 31 from the date object, according to universal time.

UTC time is the same as GMT time.

Syntax

Date.getUTCDate()

Parameters

None

Return

A Number, from 1 to 31, representing the day of the month

Example

Return the day of the month, according to universal time:

Demo

//display the day of the month, according to UTC.

var d = new Date();
var n = d.getUTCDate();
console.log(n);/* w w  w.  j  a v  a  2  s.c o m*/

//Return the UTC day of the month of a specific, local time, date-time:

var d = new Date("July 21, 2010 01:15:00");
var n = d.getUTCDate();
console.log(n);

Result