ladybird/Libraries/LibCore/TimeZone.h
Shannon Booth 74b76e21b9 LibCore: Keep ICU and libc time zones in sync
Add Core::TimeZone as the single entry point for changing the
current time zone. This updates both ICU and the process TZ/tzset
state so libc-backed helpers such as AK::UnixDateTime::to_string()
agree with JS/ICU time zone state. Previously only the ICU timezone
would be updated, which could result in inconsistent results being
returned.
2026-05-20 07:26:23 -04:00

20 lines
356 B
C++

/*
* Copyright (c) 2026, Shannon Booth <shannon@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Error.h>
#include <AK/String.h>
#include <AK/StringView.h>
#include <LibCore/Export.h>
namespace Core::TimeZone {
CORE_API ErrorOr<void> set_current_time_zone(StringView);
CORE_API String current_time_zone();
}