| 396 | // https://en.cppreference.com/w/cpp/chrono/year_month_day/operator_days |
| 397 | template <typename Unit> |
| 398 | bool IsDateTimeInRange(Unit duration) { |
| 399 | constexpr Unit kMinIncl = |
| 400 | std::chrono::duration_cast<Unit>(arrow_vendored::date::days{-12687428}); |
| 401 | constexpr Unit kMaxExcl = |
| 402 | std::chrono::duration_cast<Unit>(arrow_vendored::date::days{11248738}); |
| 403 | return duration >= kMinIncl && duration < kMaxExcl; |
| 404 | } |
| 405 | |
| 406 | // IsDateTimeInRange() specialization for nanoseconds: a 64-bit number of |
| 407 | // nanoseconds cannot represent years outside of the [-32767, 32767] |
no outgoing calls
no test coverage detected