[time.clock.tai.nonmembers] (original) (raw)
30 Time library [time]
30.7 Clocks [time.clock]
30.7.4 Class tai_clock [time.clock.tai]
30.7.4.3 Non-member functions [time.clock.tai.nonmembers]
template<class charT, class traits, class Duration> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const tai_time<Duration>& t);
Effects: Equivalent to:return os << format(os.getloc(), _STATICALLY-WIDEN_<charT>("{:L%F %T}"), t);
[Example 1: auto st = sys_days{2000y/January/1};auto tt = clock_cast<tai_clock>(st); cout << format("{0:%F %T %Z} == {1:%F %T %Z}\n", st, tt);
Produces this output:
2000-01-01 00:00:00 UTC == 2000-01-01 00:00:32 TAI
— _end example_]
template<class charT, class traits, class Duration, class Alloc = allocator<charT>> basic_istream<charT, traits>& from_stream(basic_istream<charT, traits>& is, const charT* fmt, tai_time<Duration>& tp, basic_string<charT, traits, Alloc>* abbrev = nullptr, minutes* offset = nullptr);
Effects: Attempts to parse the input stream isinto the tai_time tp using the format flags given in the NTCTS fmtas specified in [time.parse].
If the parse fails to decode a valid date,is.setstate(ios_base::failbit) is called andtp is not modified.
If %Z is used and successfully parsed, that value will be assigned to *abbrev if abbrev is non-null.
If %z (or a modified variant) is used and successfully parsed, that value will be assigned to *offset if offset is non-null.
Additionally, the parsed offset will be subtracted from the successfully parsed timestamp prior to assigning that difference to tp.