toUTCString (JavaScript)

Gets a string representing the UTC date and time.

Defined in

Date (Standard - JavaScript)

Syntax

toUTCString() : string
Return value Description
string The string representation of the date and time.

Examples

(1) This computed label displays the current date and time.
var date = new Date();
date.toUTCString()
// 26-Nov-2008 16:25:36

(2) This computed label displays the base date and time (where the time zone is -5).

var date = new Date(0);
date.toUTCString()
// 01-Jan-1970 00:00:00