27 Time library [time]

27.11 Time zones [time.zone]

27.11.2 Time zone database [time.zone.db]

27.11.2.1 Class tzdb [time.zone.db.tzdb]

namespace std::chrono {
  struct tzdb {
    string                 version;
    vector<time_zone>      zones;
    vector<time_zone_link> links;
    vector<leap_second>    leap_seconds;

    const time_zone* locate_zone(string_view tz_name) const;
    const time_zone* current_zone() const;
  };
}
Each vector in a tzdb object is sorted to enable fast lookup.
const time_zone* locate_zone(string_view tz_name) const;
Returns:
  • If zones contains an element tz for which tz.name() == tz_Β­name, a pointer to tz;
  • otherwise, if links contains an element tz_Β­l for which tz_Β­l.name() == tz_Β­name, then a pointer to the element tz of zones for which tz.name() == tz_Β­l.target().
Note
:
A time_Β­zone_Β­link specifies an alternative name for a time_Β­zone.
β€” end note
 ]
Throws: If a const time_Β­zone* cannot be found as described in the Returns: clause, throws a runtime_Β­error.
Note
:
On non-exceptional return, the return value is always a pointer to a valid time_Β­zone.
β€” end note
 ]
const time_zone* current_zone() const;
Returns: A pointer to the time zone which the computer has set as its local time zone.