mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibJS: Make Date.getUTCSeconds() call through to LibC
The tzset documentation says that TZ allows a per-second local timezone, so don't be needlessly clever here. No observable behavior difference at this point, but if we ever implement tzset, this will have a small effect.
This commit is contained in:
parent
2191ec591f
commit
697faba147
Notes:
sideshowbarker
2024-07-19 03:13:19 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/697faba1470 Pull-request: https://github.com/SerenityOS/serenity/pull/3281
2 changed files with 6 additions and 1 deletions
|
@ -87,6 +87,11 @@ int Date::utc_month() const
|
|||
return to_utc_tm().tm_mon;
|
||||
}
|
||||
|
||||
int Date::utc_seconds() const
|
||||
{
|
||||
return to_utc_tm().tm_sec;
|
||||
}
|
||||
|
||||
String Date::iso_date_string() const
|
||||
{
|
||||
auto tm = to_utc_tm();
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
int utc_milliseconds() const { return milliseconds(); }
|
||||
int utc_minutes() const;
|
||||
int utc_month() const;
|
||||
int utc_seconds() const { return seconds(); }
|
||||
int utc_seconds() const;
|
||||
|
||||
String date_string() const { return m_datetime.to_string("%a %b %d %Y"); }
|
||||
// FIXME: Deal with timezones once SerenityOS has a working tzset(3)
|
||||
|
|
Loading…
Reference in a new issue