25 Time library [time]

25.7 Clocks [time.clock]

25.7.8 Local time [time.clock.local]

The family of time points denoted by local_­time<Duration> are based on the pseudo clock local_­t.
local_­t has no member now() and thus does not meet the clock requirements.
Nevertheless local_­time<Duration> serves the vital role of representing local time with respect to a not-yet-specified time zone.
Aside from being able to get the current time, the complete time_­point algebra is available for local_­time<Duration> (just as for sys_­time<Duration>).
template<class charT, class traits, class Duration> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const local_time<Duration>& lt);
Effects:
os << sys_time<Duration>{lt.time_since_epoch()};
Returns: os.
template<class charT, class traits, class Duration> basic_ostream<charT, traits>& to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const local_time<Duration>& tp, const string* abbrev = nullptr, const seconds* offset_sec = nullptr);
Effects: Streams tp into os using the format specified by the NTCTS fmt.
fmt encoding follows the rules specified in [time.format].
If %Z is used, it will be replaced with *abbrev if abbrev is not equal to nullptr.
If abbrev is equal to nullptr (and %Z is used), os.setstate(ios_­base::failbit) shall be called.
If %z is used (or a modified variant of %z), it will be formatted with the value of *offset_­sec if offset_­sec is not equal to nullptr.
If %z (or a modified variant of %z) is used, and offset_­sec is equal to nullptr, then os.setstate(ios_­base::failbit) shall be called.
Returns: os.
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, local_time<Duration>& tp, basic_string<charT, traits, Alloc>* abbrev = nullptr, minutes* offset = nullptr);
Effects: Attempts to parse the input stream is into the local_­time tp using the format flags given in the NTCTS fmt as specified in [time.parse].
If the parse fails to decode a valid date, is.setstate(ios_­base::failbit) shall be called and tp shall not be 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.
Returns: is.