Tutorials Point


  JavaScript Basics
  JavaScript Objects
  JavaScript Advanced
  JS Useful References
  JS Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     Discussion Forums     About TP  

Javascript Date toGMTString() Method


previous next AddThis Social Bookmark Button


Advertisements

Description:

Javascript date toGMTString() method converts a date to a string, using Internet GMT conventioins.

This method is no longer used and has been replaced by the toUTCString method.

Syntax:

Date.toGMTString()

Here is the detail of parameters:

  • NA

Return Value:

Returns a date to a string, using Internet GMT conventioins.

Example:

<html>
<head>
<title>JavaScript toGMTString Method</title>
</head>
<body>
<script type="text/javascript">
   var dt = new Date(1993, 6, 28, 14, 39, 7);
   document.write( "Formated Date : " + dt.toGMTString() ); 
</script>
</body>
</html>

This will produce following result :

Formated Date : Wed, 28 Jul 1993 09:09:07 UTC 

To understand it in better way you can Try it yourself.



previous next Printer Friendly

Advertisements


  

Advertisements