The JavaScript getUTCMinutes function returns the minutes value (0 to 59) in a given date and time according to UTC (Universal Coordinated Time).
The syntax of the getUTCMinutes function is:
Date.getUTCMinutes()
Return Value: The getUTCMinutes() method returns an integer value from 0 to 59 representing the Minutes value according to UTC.
JavaScript getUTCMinutes example
In the following example, we use the getUTCMinutes method to return the total minutes as per the universal time from the current date and time.
If you observe the output, although the minutes value is 51, it returns 21. We must understand that 12:51:28 is the current local time, which is 5:30 ahead of UTC. So, the minutes difference between 51 – 30 (from 5:30) = 21.
const dt = new Date();
let m = dt.getUTCMinutes();
console.log(m);
console.log(dt);
21
Sat Jun 13 2026 12:51:28 GMT+0530 (India Standard Time)
Example 2: Using getUTCMinutes on a String date
In this JavaScript example, we use the Date() constructor to parse a string date to a datetime. Next, we apply the getUTCMinutes function to display minutes from the custom date and time per universal time. Here you can also see that 30 minutes extra.
const dt = new Date("April 1, 2017 10:12:22");
console.log(dt.getUTCMinutes());
console.log(dt);
42
Sat Apr 01 2017 10:12:22 GMT+0530 (India Standard Time)
Example 3: If we use the JavaScript getUTCMinutes() function on a date without a time. It considers 00:00:00 as the default time, and the minutes value is 0. As it adds a 30-minute difference between UTC and local time, the result is 30.
const dt = new Date("April 10, 2025");
console.log(dt.getUTCMinutes());
console.log(dt);
30
Thu Apr 10 2025 00:00:00 GMT+0530 (India Standard Time)
Example 4: If we use the getUTCMinutes() function on an invalid date, it returns NaN.
const dt = new Date("April 32, 2025 10:10:10");
console.log(dt.getUTCMinutes());
console.log(dt);
NaN
Invalid Date
What is the difference between getMinutes() and getUTCMinutes() in JavaScript?
Both getMinutes() and getUTCMinutes() methods return the minutes values from the given date.
- getMinutes(): It returns the minutes (0 to 59) from the given date according to the local system time zone.
- getUTCMinutes(): It returns the minutes from the given date according to the Universal Coordinated Time (UTC) zone.
As the local system follows Indian Standard time, which is 5 hours 50 minutes ahead of UTC, there is a difference in the result of the getMinutes() and getUTCMinutes() methods.
Here, the getMinutes() follows the local time zone and returns 10 minutes from the given date. However, getUTCMinutes() returns 40.
const dt = new Date("2026-03-01 10:10:50");
console.log(dt.getUTCMinutes());
console.log(dt.getMinutes());
console.log(dt);
40
10
Sun Mar 01 2026 10:10:50 GMT+0530 (India Standard Time)