[time.clock.utc.overview]

# 30 Time library [[time]](./#time)

## 30.7 Clocks [[time.clock]](time.clock#utc.overview)

### 30.7.3 Class utc_clock [[time.clock.utc]](time.clock.utc#overview)

#### 30.7.3.1 Overview [time.clock.utc.overview]

namespace std::chrono {class utc_clock {public:using rep = *a signed arithmetic type*; using period = ratio<*unspecified*, *unspecified*>; using duration = chrono::duration<rep, period>; using time_point = chrono::time_point<utc_clock>; static constexpr bool is_steady = *unspecified*; static time_point now(); template<class Duration>static sys_time<common_type_t<Duration, seconds>> to_sys(const utc_time<Duration>& t); template<class Duration>static utc_time<common_type_t<Duration, seconds>> from_sys(const sys_time<Duration>& t); };}

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L2834)

In contrast to sys_time,
which does not take leap seconds into account,utc_clock and its associated time_point, utc_time,
count time, including leap seconds, since 1970-01-01 00:00:00 UTC.

[*Note [1](#note-1)*:

The UTC time standard began on 1972-01-01 00:00:10 TAI.
To measure time since this epoch instead, one can add/subtract the constantsys_days{1972y/1/1} - sys_days{1970y/1/1} (63'072'000s)
from the utc_time[.](#1.sentence-1)

â *end note*]

[*Example [1](#example-1)*:   


clock_cast<utc_clock>(sys_seconds{sys_days{1970y/January/1}}).time_since_epoch() is 0s[.](#1.sentence-2)

  


clock_cast<utc_clock>(sys_seconds{sys_days{2000y/January/1}}).time_since_epoch() is 946'684'822s,  

which is 10'957 * 86'400s + 22s[.](#1.sentence-4)

  
 â *end example*]

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L2852)

utc_clock is not a [*Cpp17TrivialClock*](time.clock.req#:Cpp17TrivialClock "30.3 Cpp17Clock requirements [time.clock.req]") unless the implementation can guarantee that utc_clock​::​now() does not propagate an exception[.](#2.sentence-1)

[*Note [2](#note-2)*:

noexcept(from_sys(system_clock​::​now())) is false[.](#2.sentence-2)

â *end note*]
