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.
Its syntax is as follows −
Date.toGMTString()
Returns a date to a string, using Internet GMT conventioins.
Try the following 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>
Formated Date : Wed, 28 Jul 1993 09:09:07 GMT