Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript toUTCString() Method

JavaScript toUTCString() Method

Date Object Reference JavaScript Date object

Example

Converts a Date object to a string based on Coordinated Universal Time (UTC):

var d=new Date();

var n=d.toUTCString();

n Output result:

Try it »


Definition and Usage

The toUTCString() method converts a Date object to a string based on Coordinated Universal Time (UTC) and returns the result.

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

**Note:** UTC time is the same as GMT (Greenwich) 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 a Date object, expressed in Coordinated Universal Time (UTC).

Technical Details

JavaScript version: 1.3

Date Object Reference JavaScript Date object