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

JavaScript toGMTString() Method

The toGMTString() method should not be used. Use the toUTCString() method instead!


Date Object Reference JavaScript Date Object

Definition and Usage

The toGMTString() method converts a Date object, according to Greenwich Mean Time (GMT), to a string and returns the result.

Syntax

dateObject.toGMTString()


Tips and Notes

Note: This method should no longer be used! Use the toUTCString() method instead!!


Example

Example

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

<script type="text/javascript">

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

</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)