[time.clock.cast.fn]

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

## 30.7 Clocks [[time.clock]](time.clock#cast.fn)

### 30.7.10 time_point conversions [[time.clock.cast]](time.clock.cast#fn)

#### 30.7.10.6 Function template clock_cast [time.clock.cast.fn]

[ð](#lib:clock_cast)

`template<class DestClock, class SourceClock, class Duration>
  auto clock_cast(const time_point<SourceClock, Duration>& t);
`

[1](#1)

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

*Constraints*: At least one of the following clock time conversion expressions
is well-formed:

- [(1.1)](#1.1)

clock_time_conversion<DestClock, SourceClock>{}(t)

- [(1.2)](#1.2)

clock_time_conversion<DestClock, system_clock>{}( clock_time_conversion<system_clock, SourceClock>{}(t))

- [(1.3)](#1.3)

clock_time_conversion<DestClock, utc_clock>{}( clock_time_conversion<utc_clock, SourceClock>{}(t))

- [(1.4)](#1.4)

clock_time_conversion<DestClock, utc_clock>{}( clock_time_conversion<utc_clock, system_clock>{}( clock_time_conversion<system_clock, SourceClock>{}(t)))

- [(1.5)](#1.5)

clock_time_conversion<DestClock, system_clock>{}( clock_time_conversion<system_clock, utc_clock>{}( clock_time_conversion<utc_clock, SourceClock>{}(t)))

A clock time conversion expression is considered better than
another clock time conversion expression if it involves feweroperator() calls on clock_time_conversion specializations[.](#1.sentence-2)

[2](#2)

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

*Mandates*: Among the well-formed clock time conversion expressions
from the above list, there is a unique best expression[.](#2.sentence-1)

[3](#3)

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

*Returns*: The best well-formed clock time conversion expression in the above list[.](#3.sentence-1)
