ztsdb
Classes | Enumerations | Functions
tz Namespace Reference

Timezone handling and temporal types and functions depending on timezones. More...

Classes

struct  interval
 
struct  period
 
struct  Zone
 
struct  Zones
 

Enumerations

enum  Period : uint64_t {
  NANO, MICRO, MILLI, SECOND,
  MINUTE, HOUR, DAY, WEEK,
  MONTH, YEAR
}
 

Functions

Global::dtime plus (const Global::dtime &dt, const period &p, const tz::Zone &z)
 
Global::dtime plus (const period &p, const Global::dtime &dt, const tz::Zone &z)
 
Global::dtime minus (const Global::dtime &dt, const period &p, const tz::Zone &z)
 
tz::interval plus (const tz::interval &i, const period &p, const tz::Zone &z)
 
tz::interval plus (const period &p, const tz::interval &i, const tz::Zone &z)
 
tz::interval minus (const tz::interval &i, const period &p, const tz::Zone &z)
 
period operator- (const period &p)
 
period operator+ (const period &p1, const period &p2)
 
period operator- (const period &p1, const period &p2)
 
period operator* (const period &p1, double d)
 
period operator* (double d, const period &p1)
 
period operator/ (const period &p1, double d)
 
bool operator== (const period &p1, const period &p2)
 
bool operator!= (const period &p1, const period &p2)
 
bool operator< (const period &p1, const period &p2)
 
std::string to_string (const period &p)
 
Global::duration operator- (const interval &i1, const interval &i2)
 
bool operator== (const interval &i1, const interval &i2)
 
bool operator!= (const interval &i1, const interval &i2)
 
bool operator<= (const interval &i1, const interval &i2)
 
bool operator< (const interval &i1, const interval &i2)
 
bool operator> (const interval &i1, const interval &i2)
 
bool operator>= (const interval &i1, const interval &i2)
 
bool operator< (const Global::dtime &i1, const interval &i2)
 
bool operator> (const Global::dtime &i1, const interval &i2)
 
interval operator+ (const interval &i, const Global::duration d)
 
interval operator- (const interval &i, const Global::duration d)
 
interval operator+ (const Global::duration d, const interval &i)
 
bool start_lt (Global::dtime s1, bool sopen1, Global::dtime s2, bool sopen2)
 
bool start_gt (Global::dtime s1, bool sopen1, Global::dtime s2, bool sopen2)
 
bool start_le (Global::dtime s1, bool sopen1, Global::dtime s2, bool sopen2)
 
bool start_ge (Global::dtime s1, bool sopen1, Global::dtime s2, bool sopen2)
 
bool end_lt (Global::dtime e1, bool eopen1, Global::dtime e2, bool eopen2)
 
bool end_gt (Global::dtime e1, bool eopen1, Global::dtime e2, bool eopen2)
 
bool end_le (Global::dtime e1, bool eopen1, Global::dtime e2, bool eopen2)
 
bool end_ge (Global::dtime e1, bool eopen1, Global::dtime e2, bool eopen2)
 
bool start_lt (const interval &i1, const interval &i2)
 
bool start_gt (const interval &i1, const interval &i2)
 
bool start_le (const interval &i1, const interval &i2)
 
bool start_ge (const interval &i1, const interval &i2)
 
bool end_lt (const interval &i1, const interval &i2)
 
bool end_gt (const interval &i1, const interval &i2)
 
bool end_le (const interval &i1, const interval &i2)
 
bool end_ge (const interval &i1, const interval &i2)
 
bool end_lt_start (const interval &i1, const interval &i2)
 
bool end_gt_start (const interval &i1, const interval &i2)
 
bool end_ge_start (const interval &i1, const interval &i2)
 
bool end_le_start (const interval &i1, const interval &i2)
 
bool union_start_lt (Global::dtime s1, bool sopen1, Global::dtime s2, bool sopen2)
 
bool union_start_gt (Global::dtime s1, bool sopen1, Global::dtime s2, bool sopen2)
 
bool union_start_le (Global::dtime s1, bool sopen1, Global::dtime s2, bool sopen2)
 
bool union_start_ge (Global::dtime s1, bool sopen1, Global::dtime s2, bool sopen2)
 
bool union_end_lt (Global::dtime e1, bool eopen1, Global::dtime e2, bool eopen2)
 
bool union_end_gt (Global::dtime e1, bool eopen1, Global::dtime e2, bool eopen2)
 
bool union_end_le (Global::dtime e1, bool eopen1, Global::dtime e2, bool eopen2)
 
bool union_end_ge (Global::dtime e1, bool eopen1, Global::dtime e2, bool eopen2)
 
bool union_start_lt (const interval &i1, const interval &i2)
 
bool union_start_gt (const interval &i1, const interval &i2)
 
bool union_start_le (const interval &i1, const interval &i2)
 
bool union_start_ge (const interval &i1, const interval &i2)
 
bool union_end_lt (const interval &i1, const interval &i2)
 
bool union_end_gt (const interval &i1, const interval &i2)
 
bool union_end_le (const interval &i1, const interval &i2)
 
bool union_end_ge (const interval &i1, const interval &i2)
 
bool union_end_lt_start (const interval &i1, const interval &i2)
 
bool union_end_gt_start (const interval &i1, const interval &i2)
 
bool union_end_ge_start (const interval &i1, const interval &i2)
 
bool union_end_le_start (const interval &i1, const interval &i2)
 
std::string to_string (const Zone &z)
 
std::string summary (const Zone &z)
 
std::string to_string (const Zones &zs)
 
template<class Rep , class Period >
Global::duration duration_from_string2 (const std::string &s)
 
std::string to_string (Global::dtime dt, const std::string &format, const tz::Zone &timezone, const std::string &timezone_str, bool abbrev=false, bool fractional=false)
 
Global::dtime dtime_from_numbers (int year, unsigned month, unsigned day, unsigned hour, unsigned minute, unsigned second, unsigned nsecond, const tz::Zone &z)
 
Global::dtime dtime_from_string (const std::string &s, const tz::Zones &tzones, const std::string &fmt="%Y-%m-%d %H:%M:%S[.%s] %Z", const std::string &tz="")
 
std::string to_string (const tz::interval &i, const std::string &format, const tz::Zone &timezone, const std::string &timezone_str, bool abbrev=false, bool fractional=false)
 
interval interval_from_string (const std::string &s, const tz::Zones &tzones, const std::string &fmt="%Y-%m-%d %H:%M:%S[.%s] %Z", const std::string &tz="")
 
std::string to_string (Global::duration d)
 
tz::Period unqualified_period_from_string (const std::string &s)
 

Detailed Description

Timezone handling and temporal types and functions depending on timezones.

Function Documentation

◆ end_ge_start()

bool tz::end_ge_start ( const interval i1,
const interval i2 
)
inline

True if the end of 'i1' is greater or equal than the start of 'i2'. This tests that 'i1' and 'i2' "touch" and that 'i2' is after 'i1'.

◆ end_lt_start()

bool tz::end_lt_start ( const interval i1,
const interval i2 
)
inline

True if the end of 'i1' is smaller than the start of 'i2'. This tests that 'i1' and 'i2' are disjoint and 'i2' is after 'i1'.

◆ operator<()

bool tz::operator< ( const period p1,
const period p2 
)
inline

This operator is meaningless, but needs to be defined because of the intended template usage.

◆ union_end_ge_start()

bool tz::union_end_ge_start ( const interval i1,
const interval i2 
)
inline

True if the end of 'i1' is greater or equal than the start of 'i2'. This tests that 'i1' and 'i2' "touch" and that 'i2' is after 'i1'.

◆ union_end_lt_start()

bool tz::union_end_lt_start ( const interval i1,
const interval i2 
)
inline

True if the end of 'i1' is smaller than the start of 'i2'. This tests that 'i1' and 'i2' are disjoint and 'i2' is after 'i1'.

◆ union_start_lt()

bool tz::union_start_lt ( Global::dtime  s1,
bool  sopen1,
Global::dtime  s2,
bool  sopen2 
)
inline

In unions, we have the following rules: oo is disjoint, but oc, co, and cc touch