Date.getUTCDate()

Returns the day of the month, according to universal time (from 1-31)

The getUTCDate() method returns the day (date) of the month in the specified date according to universal time.

var date1 = new Date('August 19, 1975 23:15:30 GMT+11:00');
var date2 = new Date('August 19, 1975 23:15:30 GMT-11:00');

console.log(date1.getUTCDate());
// expected output: 19

console.log(date2.getUTCDate());
// expected output: 20

Syntax

dateObj.getUTCDate()

Return value

An integer number, between 1 and 31, representing the day of the month in the given date according to universal time.

Examples

Using getUTCDate()

The following example assigns the day portion of the current date to the variable day.

var today = new Date();
var day = today.getUTCDate();

References

Contributors to this page

Uros Durdevic

Last updated