1
Vote

Date "toGMTString()" method missing

description

Date class doesn't have the "toGMTString()" method.

Workaround:

var c = d.toUTCString();
c = c.replace("UTC", "GMT");

comments

andersekdahl wrote Apr 27, 2012 at 8:07 AM

toGMTString() is deprecated in favor of toUTCString() by most JS implementations (although most still implement it), so I don't think that this should be added. The fact that toUTCString() returns "UTC" at the end instead of "GMT" isn't a bug, but an ambiguity in spec where the format can depend on the platform. Firefox and Chrome returns "GMT" at the end while IE9 returns "UTC".