Files
cppdraft_translate/cppdraft/time/hms/nonmembers.md
2025-10-25 03:02:53 +03:00

32 lines
968 B
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[time.hms.nonmembers]
# 30 Time library [[time]](./#time)
## 30.9 Class template hh_mm_ss [[time.hms]](time.hms#nonmembers)
### 30.9.3 Non-members [time.hms.nonmembers]
[🔗](#itemdecl:1)
`template<class charT, class traits, class Duration>
basic_ostream<charT, traits>&
operator<<(basic_ostream<charT, traits>& os, const hh_mm_ss<Duration>& hms);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8635)
*Effects*: Equivalent to:return os << format(os.getloc(), *STATICALLY-WIDEN*<charT>("{:L%T}"), hms);
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L8642)
[*Example [1](#example-1)*: for (auto ms : {-4083007ms, 4083007ms, 65745123ms}) { hh_mm_ss hms{ms};
cout << hms << '\n';} cout << hh_mm_ss{65745s} << '\n';
Produces the output (assuming the "C" locale):-01:08:03.00701:08:03.00718:15:45.12318:15:45
— *end example*]