Make use of the toUTCString() method from the Date() constructor to get the current UTC time and date in JavaScript.
Example 1: Current Date and Time in UTC
const date = new Date();
const utcDateString = date.toUTCString();
console.log("Current GMT Date Time: " + utcDateString);
Output:
Example 2: Current Time in GMT
const date = new Date();
const utcTimeString = date.toUTCString().split(" ")[4];
console.log("Current GMT Time: " + utcTimeString);
Output:
Example 3: Current Date in GMT
const date = new Date();
const utcDateString = date.toUTCString().split(" ").slice(1, 4).join(" ");
console.log("Current GMT Date: " + utcDateString);
Output:
What is UTC Timezone?
UTC (Coordinated Universal Time) is a stable Global Time Standard, which does not observe Daylight Saving Time (DST) and is often used as a reference for precise timekeeping in JavaScript and various applications.

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!