std::chrono::operator<<(std::chrono::sys_time)
From cppreference.com
< cpp | chrono | system clock
template <class CharT, class Traits, class Duration> std::basic_ostream<CharT, Traits>& |
(1) | (since C++20) |
template <class CharT, class Traits, class Duration> std::basic_ostream<CharT, Traits>& |
(2) | (since C++20) |
Outputs tp
into the stream os
.
1) Equivalent to:
auto const dp = std::chrono::floor<std::chrono::days>(tp); os << std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{} {}"), std::chrono::year_month_day(dp), std::chrono::time_of_day(tp - dp));
where STATICALLY_WIDEN<CharT>("{} {}") is "{} {}" if CharT
is char
, and L"{} {}" if CharT
is wchar_t
.
2) Equivalent to os << std::chrono::year_month_day(tp);
Return value
os
.
See also
specialization of std::formatter that formats a sys_time according to the provided format (class template specialization) | |
(C++20) |
stores formatted representation of the arguments in a new string (function template) |
outputs a year_month_day into a stream (function template) |