From http://www.w3schools.com (Copyright Refsnes Data)

JavaScript toUTCString() Method


Date Object Reference JavaScript Date Object

Definition and Usage

The toUTCString() method converts a date to a string (according to universal time).

Syntax

dateObject.toUTCString()


Example

Example

Convert today's date (according to UTC) to a string:

<script type="text/javascript">

var d=new Date();
document.write("Original form: ");
document.write(d + "<br />");
document.write("toUTCString() form: ");
document.write(d.toUTCString());

</script>

The output of the code above will be:


Try it yourself »


Date Object Reference JavaScript Date Object

From http://www.w3schools.com (Copyright Refsnes Data)