Mega Code Archive

 
Categories / JavaScript Tutorial / Date
 

Date toGMTString()

Syntax date.toGMTString() The toGMTString() method returns a string representing the universal time of the Date object. The date is converted to the GMT time zone before being converted to a string. The format of the string will look similar to the following: Mon, 24 Oct 1982 12:03:27 GMT <html>     <script language="JavaScript">     <!--     theDate = new Date();     document.write(theDate.toGMTString());     -->     </script>     </html>