mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00

This is a wrapper API around the POSIX tzset / tzname information. It is to help ensure that tzset is invoked before accessing tzname.
26 lines
632 B
C++
26 lines
632 B
C++
/*
|
|
* Copyright (c) 2022, Tim Flynn <trflynn89@pm.me>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Optional.h>
|
|
#include <AK/StringView.h>
|
|
#include <AK/Time.h>
|
|
#include <AK/Types.h>
|
|
#include <LibTimeZone/Forward.h>
|
|
|
|
namespace TimeZone {
|
|
|
|
StringView current_time_zone();
|
|
|
|
Optional<TimeZone> time_zone_from_string(StringView time_zone);
|
|
StringView time_zone_to_string(TimeZone time_zone);
|
|
Optional<StringView> canonicalize_time_zone(StringView time_zone);
|
|
|
|
Optional<i64> get_time_zone_offset(TimeZone time_zone, AK::Time time);
|
|
Optional<i64> get_time_zone_offset(StringView time_zone, AK::Time time);
|
|
|
|
}
|