| 96 | } |
| 97 | |
| 98 | inline time_t TimePointToUnixTime(const cctz::time_point<cctz::sys_seconds>& tp) { |
| 99 | static const cctz::time_point<cctz::sys_seconds> epoch = |
| 100 | std::chrono::time_point_cast<cctz::sys_seconds>( |
| 101 | std::chrono::system_clock::from_time_t(0)); |
| 102 | return (tp - epoch).count(); |
| 103 | } |
| 104 | |
| 105 | // Returns 'true' iff 'cs' is out of valid range (years 1400..9999 are considered valid). |
| 106 | inline bool IsDateOutOfRange(const cctz::civil_second& cs) { |