JavaScript toUTCString()Method

Date 对象参考手册JavaScript Date Object

Example

Convert a Date object to a string according to the universal time (UTC):

var d=new Date();
var n=d.toUTCString();

nOutput result:


Try it yourself »

Definition and Usage

The toUTCString() method converts a Date object to a string according to the universal time (UTC) and returns the result.

Tip:Coordinated Universal Time, also known as Universal Time, World Standard Time, International Coordinated Time, abbreviated as UTC. It comes from the English "Coordinated Universal Time"/French "Temps Universel Cordonné".

Note:UTC time is the same as GMT (Greenwich Mean Time).


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the toUTCString() method.


Syntax

Date.toUTCString()

Return Value

Type Description
String A string representation of the date Object, expressed in universal time (UTC).

Technical Details

JavaScript Version: 1.3


Date 对象参考手册JavaScript Date Object

Other Extensions