JavaScript » Date » toGMTString

Syntax:
object.toGMTString( )

The DateFunction toGMTString is deprecated in Javascript 1.5.


This method converts a local date to Greenwich Mean Time.

Examples

Code:
myDate = new Date()
document.write(myDate.toGMTString())
Output:
Fri, 29 Oct 1999 16:28:58 UTC
Explanation:

This example uses the toGMTString method to convert the date set in the myDate object to Greenwich Mean Time and returns this date as a string.