Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
Time Zone Conversions

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

Topics

 Time zone conversion helpers

Files

file  time_zone_conversions.hpp
 Helpers for converting supported regional time zones and UTC.
file  time_zone_offset.hpp
 UTC offset arithmetic helpers (UTC <-> local) and TimeZoneStruct offset extraction.

Detailed Description

Helpers for converting supported regional time zones and UTC.

These helpers cover:

  • DST-aware European civil time (WET, CET, EET) with the existing rule set,
  • DST-aware US civil time (ET, CT),
  • fixed-offset trading-oriented zones such as IST, MYT, WIB, WITA, WIT, KZT, TRT, BYT, SGT, ICT, PHT, GST, HKT, JST, and KST,
  • generic zone_to_gmt, gmt_to_zone, and convert_time_zone entry points.

Example Usage:

ts_t gmt_ts = time_shield::to_ts(2024, Month::JUN, 21, 12, 0, 0);
ts_t ist_ts = time_shield::gmt_to_ist(gmt_ts);
ts_t gmt_to_ist(ts_t gmt)
ts_t convert_time_zone(ts_t local, TimeZone from, TimeZone to)
Convert a timestamp between two supported local civil time zones.
TIME_SHIELD_CONSTEXPR ts_t to_ts(year_t year, int month, int day)
Alias for to_timestamp.
@ MYT
Malaysia Time.
Definition enums.hpp:188
@ IST
India Standard Time.
Definition enums.hpp:187