Javascript Reference - JavaScript toUTCString() Method








toUTCString() displays the complete UTC date according to universal time.

UTC time is the same as GMT time.

Browser Support

toUTCString() Yes Yes Yes Yes Yes

Syntax


dateObject.toUTCString();

Parameters

None.

Return Value

A string representing the UTC date and time as a string.





Example


var aDate = new Date(Date.UTC(2021, 5, 4, 12, 21, 55)); 
console.log(aDate.toUTCString()); 

The code above generates the following result.