LibJS: Add Date.prototype.toGMTString()

This commit is contained in:
Andreas Kling 2021-03-14 16:40:41 +01:00
commit 093331df06
Notes: sideshowbarker 2024-07-18 21:19:55 +09:00
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();