1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

LibJS: Add Date.prototype.toGMTString()

This commit is contained in:
Andreas Kling 2021-03-14 16:40:41 +01:00
parent 36ea9fbd9e
commit 093331df06
5 changed files with 20 additions and 0 deletions

View file

@ -91,6 +91,13 @@ int Date::utc_seconds() const
return to_utc_tm().tm_sec;
}
String Date::gmt_date_string() const
{
// Mon, 18 Dec 1995 17:28:35 GMT
// FIXME: Note that we're totally cheating with the timezone part here..
return datetime().to_string("%a, %e %b %Y %T GMT");
}
String Date::iso_date_string() const
{
auto tm = to_utc_tm();