Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
time_zone_conversions.hpp File Reference

Helpers for converting supported regional time zones and UTC. More...

Go to the source code of this file.

Classes

struct  time_shield::LocalTimeResolution
 Result of explicit local-time resolution. More...

Namespaces

namespace  time_shield
 Main namespace for the Time Shield library.
namespace  time_shield::detail

Functions

ts_t time_shield::detail::cet_to_gmt_impl (ts_t cet)
ts_t time_shield::detail::gmt_to_cet_impl (ts_t gmt)
ts_t time_shield::detail::european_local_to_gmt (ts_t local, int standard_offset_hours)
ts_t time_shield::detail::gmt_to_european_local (ts_t gmt, int standard_offset_hours)
bool time_shield::detail::is_us_eastern_dst_local (const DateTimeStruct &dt)
bool time_shield::detail::fixed_zone_offset (TimeZone zone, tz_t &utc_offset)
ts_ms_t time_shield::detail::zone_to_gmt_ms_by_seconds (ts_ms_t local_ms, TimeZone zone)
ts_ms_t time_shield::detail::gmt_to_zone_ms_by_seconds (ts_ms_t gmt_ms, TimeZone zone)
LocalTimeResolution time_shield::detail::make_local_time_resolution (LocalTimeStatus status, ts_ms_t first_utc_ms=ERROR_TIMESTAMP, ts_ms_t second_utc_ms=ERROR_TIMESTAMP)
bool time_shield::detail::dynamic_dst_zone_offsets (TimeZone zone, tz_t &first_offset, tz_t &second_offset)
tz_t time_shield::detail::dynamic_zone_standard_offset (TimeZone zone)
bool time_shield::detail::is_european_dynamic_zone (TimeZone zone)
bool time_shield::detail::is_us_dynamic_zone (TimeZone zone)
bool time_shield::detail::european_dst_at_utc_ms (ts_ms_t utc_ms)
int time_shield::detail::first_sunday_month_day (int year, int month)
bool time_shield::detail::us_dst_at_utc_ms (TimeZone zone, ts_ms_t utc_ms)
bool time_shield::detail::dynamic_offset_applies_at_utc_ms (TimeZone zone, ts_ms_t utc_ms, tz_t offset)
void time_shield::detail::add_local_time_candidate (LocalTimeResolution &result, ts_ms_t local_ms, TimeZone zone, tz_t offset)
LocalTimeResolution time_shield::detail::resolve_with_dynamic_offsets (ts_ms_t local_ms, TimeZone zone, tz_t first_offset, tz_t second_offset)
bool time_shield::detail::local_time_status_has_utc (LocalTimeStatus status)
ts_ms_t time_shield::detail::local_time_resolution_to_utc (const LocalTimeResolution &resolution, AmbiguousTimePolicy ambiguous_policy)
ts_ms_t time_shield::detail::shift_nonexistent_local_time_ms (ts_ms_t local_ms, TimeZone zone, int direction)
enum class  time_shield::LocalTimeStatus { time_shield::valid , time_shield::nonexistent , time_shield::ambiguous , time_shield::unsupported }
 Classification of a local civil timestamp in a time zone. More...
enum class  time_shield::AmbiguousTimePolicy { time_shield::first_occurrence , time_shield::second_occurrence , time_shield::error }
 Policy for ambiguous local civil timestamps. More...
enum class  time_shield::NonexistentTimePolicy { time_shield::error , time_shield::shift_forward , time_shield::shift_backward }
 Policy for nonexistent local civil timestamps. More...
ts_t time_shield::zone_to_gmt (ts_t local, TimeZone zone)
 Convert supported local civil time to GMT (UTC).
ts_t time_shield::gmt_to_zone (ts_t gmt, TimeZone zone)
 Convert GMT (UTC) to a supported local civil time zone.
ts_ms_t time_shield::zone_to_gmt_ms (ts_ms_t local_ms, TimeZone zone)
 Convert supported local civil time in milliseconds to GMT (UTC).
ts_ms_t time_shield::gmt_to_zone_ms (ts_ms_t gmt_ms, TimeZone zone)
 Convert GMT (UTC) in milliseconds to a supported local civil time zone.
ts_t time_shield::cet_to_gmt (ts_t cet)
 Convert Central European Time to Greenwich Mean Time.
ts_t time_shield::eet_to_gmt (ts_t eet)
 Convert Eastern European Time to Greenwich Mean Time.
bool time_shield::is_us_eastern_dst_local (const DateTimeStruct &dt)
 Check if local US Eastern time uses DST.
ts_t time_shield::et_to_gmt (ts_t et)
 Convert US Eastern Time (New York, EST/EDT) to GMT (UTC).
ts_t time_shield::gmt_to_et (ts_t gmt)
 Convert GMT (UTC) to US Eastern Time (New York, EST/EDT).
ts_t time_shield::ny_to_gmt (ts_t ny)
 Convert New York Time to GMT (UTC).
ts_t time_shield::gmt_to_ny (ts_t gmt)
 Convert GMT (UTC) to New York Time.
ts_t time_shield::ct_to_gmt (ts_t ct)
 Convert US Central Time (America/Chicago, CST/CDT) to GMT (UTC).
ts_t time_shield::gmt_to_ct (ts_t gmt)
 Convert GMT (UTC) to US Central Time (America/Chicago, CST/CDT).
ts_t time_shield::gmt_to_cet (ts_t gmt)
 Convert Greenwich Mean Time to Central European Time.
ts_t time_shield::gmt_to_eet (ts_t gmt)
 Convert Greenwich Mean Time to Eastern European Time.
ts_t time_shield::convert_time_zone (ts_t local, TimeZone from, TimeZone to)
 Convert a timestamp between two supported local civil time zones.
ts_ms_t time_shield::convert_time_zone_ms (ts_ms_t local_ms, TimeZone from, TimeZone to)
 Convert a millisecond timestamp between two supported local civil time zones.
bool time_shield::zone_offset_at_utc_ms (ts_ms_t utc_ms, TimeZone zone, tz_t &out) noexcept
 Resolve the effective UTC offset for a UTC millisecond instant.
bool time_shield::zone_offset_at_utc (ts_t utc, TimeZone zone, tz_t &out) noexcept
 Resolve the effective UTC offset for a UTC second instant.
LocalTimeResolution time_shield::resolve_local_time_ms (ts_ms_t local_ms, TimeZone zone)
 Resolve local civil time to zero, one, or two UTC candidates.
LocalTimeResolution time_shield::resolve_local_time (ts_t local, TimeZone zone)
 Resolve local civil time given in seconds.
ts_ms_t time_shield::zone_to_gmt_ms (ts_ms_t local_ms, TimeZone zone, AmbiguousTimePolicy ambiguous_policy, NonexistentTimePolicy nonexistent_policy)
 Convert local civil time to UTC with explicit DST policies.
ts_t time_shield::zone_to_gmt (ts_t local, TimeZone zone, AmbiguousTimePolicy ambiguous_policy, NonexistentTimePolicy nonexistent_policy)
 Convert local civil time in seconds to UTC with explicit DST policies.
ts_ms_t time_shield::zone_to_gmt_ms_strict (ts_ms_t local_ms, TimeZone zone)
 Convert only unambiguous existing local time to UTC.
ts_t time_shield::zone_to_gmt_strict (ts_t local, TimeZone zone)
 Convert only unambiguous existing local time in seconds to UTC.
ts_ms_t time_shield::convert_time_zone_ms (ts_ms_t local_ms, TimeZone from, TimeZone to, AmbiguousTimePolicy ambiguous_policy, NonexistentTimePolicy nonexistent_policy)
 Convert local civil time between zones with explicit DST policies.
ts_t time_shield::convert_time_zone (ts_t local, TimeZone from, TimeZone to, AmbiguousTimePolicy ambiguous_policy, NonexistentTimePolicy nonexistent_policy)
 Convert local civil time in seconds between zones with explicit DST policies.
ts_t time_shield::ist_to_gmt (ts_t ist)
ts_t time_shield::gmt_to_ist (ts_t gmt)
ts_t time_shield::myt_to_gmt (ts_t myt)
ts_t time_shield::gmt_to_myt (ts_t gmt)
ts_t time_shield::wib_to_gmt (ts_t wib)
ts_t time_shield::gmt_to_wib (ts_t gmt)
ts_t time_shield::wita_to_gmt (ts_t wita)
ts_t time_shield::gmt_to_wita (ts_t gmt)
ts_t time_shield::wit_to_gmt (ts_t wit)
ts_t time_shield::gmt_to_wit (ts_t gmt)
ts_t time_shield::kzt_to_gmt (ts_t kzt)
ts_t time_shield::gmt_to_kzt (ts_t gmt)
ts_t time_shield::trt_to_gmt (ts_t trt)
ts_t time_shield::gmt_to_trt (ts_t gmt)
ts_t time_shield::byt_to_gmt (ts_t byt)
ts_t time_shield::gmt_to_byt (ts_t gmt)
ts_t time_shield::sgt_to_gmt (ts_t sgt)
ts_t time_shield::gmt_to_sgt (ts_t gmt)
ts_t time_shield::ict_to_gmt (ts_t ict)
ts_t time_shield::gmt_to_ict (ts_t gmt)
ts_t time_shield::pht_to_gmt (ts_t pht)
ts_t time_shield::gmt_to_pht (ts_t gmt)
ts_t time_shield::gst_to_gmt (ts_t gst)
ts_t time_shield::gmt_to_gst (ts_t gmt)
ts_t time_shield::hkt_to_gmt (ts_t hkt)
ts_t time_shield::gmt_to_hkt (ts_t gmt)
ts_t time_shield::jst_to_gmt (ts_t jst)
ts_t time_shield::gmt_to_jst (ts_t gmt)
ts_t time_shield::kst_to_gmt (ts_t kst)
ts_t time_shield::gmt_to_kst (ts_t gmt)
ts_t time_shield::kyiv_to_gmt (ts_t kyiv)
 Convert Kyiv civil time to GMT using the EET/EEST rules.
ts_t time_shield::gmt_to_kyiv (ts_t gmt)
 Convert GMT to Kyiv civil time using the EET/EEST rules.

Detailed Description

Helpers for converting supported regional time zones and UTC.

Definition in file time_zone_conversions.hpp.