[time.clock.utc.members]

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

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

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

#### 30.7.3.2 Member functions [time.clock.utc.members]

[ð](#lib:now,utc_clock)

`static time_point now();
`

[1](#1)

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

*Returns*: from_sys(system_clock​::​now()), or a more accurate value of utc_time[.](#1.sentence-1)

[ð](#lib:to_sys,utc_clock)

`template<class Duration>
  static sys_time<common_type_t<Duration, seconds>>
    to_sys(const utc_time<Duration>& u);
`

[2](#2)

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

*Returns*: A sys_time t,
such that from_sys(t) == u if such a mapping exists[.](#2.sentence-1)

Otherwise u represents a time_point during a positive leap second insertion,
the conversion counts that leap second as not inserted,
and the last representable value of sys_time prior to the insertion of the leap second is returned[.](#2.sentence-2)

[ð](#lib:from_sys,utc_clock)

`template<class Duration>
  static utc_time<common_type_t<Duration, seconds>>
    from_sys(const sys_time<Duration>& t);
`

[3](#3)

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

*Returns*: A utc_time u, such thatu.time_since_epoch() - t.time_since_epoch() is equal to the sum of leap seconds that were inserted
between t and 1970-01-01[.](#3.sentence-1)

If t is exactly the date of leap second insertion,
then the conversion counts that leap second as inserted[.](#3.sentence-2)

[*Example [1](#example-1)*: auto t = sys_days{July/1/2015} - 2ns;auto u = utc_clock::from_sys(t);
assert(u.time_since_epoch() - t.time_since_epoch() == 25s);
t += 1ns;
u = utc_clock::from_sys(t);
assert(u.time_since_epoch() - t.time_since_epoch() == 25s);
t += 1ns;
u = utc_clock::from_sys(t);
assert(u.time_since_epoch() - t.time_since_epoch() == 26s);
t += 1ns;
u = utc_clock::from_sys(t);
assert(u.time_since_epoch() - t.time_since_epoch() == 26s); â *end example*]
