diff --git a/date.h b/date.h index 6c7f894..ea5da95 100644 --- a/date.h +++ b/date.h @@ -3386,20 +3386,35 @@ make_time(std::chrono::hours h, std::chrono::minutes m, std::chrono::seconds s, return time_of_day>(h, m, s, sub_s, md); } -template ::value>::type> +template inline -std::ostream& +typename std::enable_if +< + !std::chrono::treat_as_floating_point::value && + Duration{1} < days{1} + , std::ostream& +>::type operator<<(std::ostream& os, - const std::chrono::time_point - >>& tp) + const std::chrono::time_point& tp) { auto const dp = floor(tp); return os << year_month_day(dp) << ' ' << make_time(tp-dp); } +template +inline +typename std::enable_if +< + !std::chrono::treat_as_floating_point::value && + Duration{1} >= days{1} + , std::ostream& +>::type +operator<<(std::ostream& os, + const std::chrono::time_point& tp) +{ + return os << year_month_day(floor(tp)); +} + } // namespace date #endif // DATE_H