Files
2025-10-25 03:02:53 +03:00

2.5 KiB
Raw Permalink Blame History

[time.clock.local]

30 Time library [time]

30.7 Clocks [time.clock]

30.7.9 Local time [time.clock.local]

1

#

The family of time points denoted by local_time 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 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 (just as for sys_time).

🔗

template<class charT, class traits, class Duration> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const local_time<Duration>& lt);

2

#

Effects: os << sys_time{lt.time_since_epoch()};

3

#

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);

4

#

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) 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.

5

#

Returns: is.