JavaScript getUTCDate Function

The JavaScript getUTCDate function is one of the Date Functions, which returns the day of the month number between 1 and 31 on a given date according to UTC (Coordinated Universal Time).

The syntax of the getUTCDate function is

dateObject.getUTCDate()

Return Value: As you can see, the getUTCDate() does not accept any parameter value and returns the day of the month number from 1 to 31.

JavaScript getUTCDate Example

In the following example, we use the getUTCDate() function to get the day of the month number from the current date and time.

const dt = new Date();
let d = dt.getUTCDate();
console.log(d)
console.log(dt)
13
Sat Jun 13 2026 10:44:10 GMT+0530 (India Standard Time)

Example 2: Get Day of the Month from a custom date

In this JavaScript example, we used the Date() object to create a date from the custom date and time. Next, we use the getUTCDate() method to display the day of the month number from the custom date.

const dt = new Date("December 14, 2016 11:22:34");
console.log(dt.getUTCDate())
14

Example 3: getUTCDate returns NaN

We must use the JavaScript getUTCDate() function on a valid Date, and if we use it on an invalid date, it returns NaN. For instance, if we use a date with the wrong day number or month number, it becomes an invalid date. If we use the getUTCDate on an invalid date, it returns NaN.

const dt = new Date("December 35, 2016 11:22:34");
console.log(dt);
console.log(dt.getUTCDate())
Invalid Date
NaN

Example 4: Using getUTCDate on a string

When parsing the string date, if we miss the day of the month part, it considers 1 as the default date value. So, if we apply the getUTCDate() function on a date without the day of the month number, it returns 1.

const dt = new Date("December 2016 11:22:34");
console.log(dt);
console.log(dt.getUTCDate())
Thu Dec 01 2016 11:22:34 GMT+0530 (India Standard Time)
1

Why is getUTCDate returning yesterday’s date?

When you are living in America or any other region whose time zone is below UTC, the getUTCDate returns the previous date. To demonstrate it, we changed the system time zone to Hawaii.

const dt = new Date();
console.log(dt);
console.log(dt.getDate());
console.log(dt.getUTCDate());
Fri Jun 12 2026 18:44:58 GMT-1000 (Hawaii-Aleutian Standard Time) 
12 
13

What is the difference between getDate() and getUTCDate?

Both the getDate() function and the JavaScript getUTCDate() method return the day of the month number between 1 and 31.

  • getDate(): It returns the day of the month number according to the local system time zone.
  • getUTCDate(): It returns the day of the month number according to the UTC (Universal ) zone.

The following example shows the result.

const dt = new Date();
console.log(dt.getDate());
console.log(dt.getUTCDate());
13
13

JS Convert UTC to local time

We can use the built-in toString() function to convert the UTC date and time to the local date and time (according to the local system time zone).

const utcdt = "2026-06-13T10:30:45.123Z";
console.log(utcdt);

const localDt = new Date(utcdt);
console.log(localDt.toString());
2026-06-13T10:30:45.123Z 
Sat Jun 13 2026 00:30:45 GMT-1000 (Hawaii-Aleutian Standard Time)