JavaScript Date toUTCString() method

Definition and usage

toUTCString() The method converts a Date object to a string based on UTC.

Tip:Coordinated Universal Time (UTC) is the time set by the world time standard.

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

Example

Convert a Date object to a string based on UTC:

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

Try it yourself

Syntax

Date.toUTCString()

Parameter

No parameters.

Technical details

Return value: String, represented as a string in UTC date and time.
JavaScript version: ECMAScript 1

Browser support

Method Chrome IE Firefox Safari Opera
toUTCString() Support Support Support Support Support

Related Pages

Tutorial:JavaScript Date

Tutorial:JavaScript Date Format

Tutorial:JavaScript String