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

1.6 KiB

[time.clock.system.overview]

30 Time library [time]

30.7 Clocks [time.clock]

30.7.2 Class system_clock [time.clock.system]

30.7.2.1 Overview [time.clock.system.overview]

namespace std::chrono {class system_clock {public:using rep = see below; using period = ratio<unspecified, unspecified>; using duration = chrono::duration<rep, period>; using time_point = chrono::time_point<system_clock>; static constexpr bool is_steady = unspecified; static time_point now() noexcept; // mapping to/from C type time_tstatic time_t to_time_t (const time_point& t) noexcept; static time_point from_time_t(time_t t) noexcept; };}

1

#

Objects of type system_clock represent wall clock time from the system-wide realtime clock.

Objects of type sys_time measure time since 1970-01-01 00:00:00 UTC excluding leap seconds.

This measure is commonly referred to as Unix time.

This measure facilitates an efficient mapping betweensys_time and calendar types ([time.cal]).

[Example 1:

sys_seconds{sys_days{1970y/January/1}}.time_since_epoch() is 0s.

sys_seconds{sys_days{2000y/January/1}}.time_since_epoch() is 946'684'800s, which is 10'957 * 86'400s.

— end example]