1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +00:00

LibJS: Add Date methods: setHours, setMinutes, setSeconds, setMilliseconds

This commit is contained in:
tuqqu 2021-03-19 22:12:08 +03:00 committed by Andreas Kling
parent 974a981ded
commit 43f0c92bcd
8 changed files with 190 additions and 1 deletions

View file

@ -63,6 +63,11 @@ public:
int utc_month() const;
int utc_seconds() const;
void set_milliseconds(u16 milliseconds)
{
m_milliseconds = milliseconds;
}
String date_string() const { return m_datetime.to_string("%a %b %d %Y"); }
// FIXME: Deal with timezones once SerenityOS has a working tzset(3)
String time_string() const { return m_datetime.to_string("%T GMT+0000 (UTC)"); }