Visit Mozilla.org

Core JavaScript 1.5 Reference:Global Objects:Date:toGMTString

From MDC

Deprecated

Contents

[edit] Summary

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

Method of Date
Implemented in: JavaScript 1.0, NES 2.0

JavaScript 1.3: Deprecated.

ECMA Version: ECMA-262

[edit] Syntax

toGMTString()

[edit] Parameters

None.

[edit] Description

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

The exact format of the value returned by toGMTString varies according to the platform.

You should use Date.toUTCString instead of toGMTSTring.

[edit] Examples

[edit] Example: Using toGMTString

In the following example, today is a Date object:

today.toGMTString()

In this example, the toGMTString method converts the date to GMT (UTC) using the operating system's time-zone offset and returns a string value that is similar to the following form. The exact format depends on the platform.

Mon, 18 Dec 1995 17:28:35 GMT

[edit] See Also

toLocaleString, toUTCString