JavaScript Date toUTCString()
Example
Get a date object as a string, according to UTC:
const d = new Date();
let text = d.toUTCString();
Try it Yourself »
Description
The toUTCString() method returns a date object as a string, according to UTC.
Tip: The Universal Coordinated Time (UTC) is the time set by the World Time Standard.
Note: UTC time is the same as GMT time.
Browser Support
toUTCString()
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
Date.toUTCString()
Parameters
None |
Technical Details
Return Value: | A String, representing the UTC date and time as a string |
---|---|
JavaScript Version: | ECMAScript 1 |