[time.point.cast]

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

## 30.6 Class template time_point [[time.point]](time.point#cast)

### 30.6.8 Conversions [time.point.cast]

[ð](#lib:time_point,time_point_cast)

`template<class ToDuration, class Clock, class Duration>
  constexpr time_point<Clock, ToDuration> time_point_cast(const time_point<Clock, Duration>& t);
`

[1](#1)

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

*Constraints*: ToDuration is a specialization of duration[.](#1.sentence-1)

[2](#2)

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

*Returns*: time_point<Clock, ToDuration>(duration_cast<ToDuration>(t.time_since_epoch()))

[ð](#lib:floor,time_point)

`template<class ToDuration, class Clock, class Duration>
  constexpr time_point<Clock, ToDuration> floor(const time_point<Clock, Duration>& tp);
`

[3](#3)

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

*Constraints*: ToDuration is a specialization of duration[.](#3.sentence-1)

[4](#4)

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

*Returns*: time_point<Clock, ToDuration>(floor<ToDuration>(tp.time_since_epoch()))[.](#4.sentence-1)

[ð](#lib:ceil,time_point)

`template<class ToDuration, class Clock, class Duration>
  constexpr time_point<Clock, ToDuration> ceil(const time_point<Clock, Duration>& tp);
`

[5](#5)

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

*Constraints*: ToDuration is a specialization of duration[.](#5.sentence-1)

[6](#6)

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

*Returns*: time_point<Clock, ToDuration>(ceil<ToDuration>(tp.time_since_epoch()))[.](#6.sentence-1)

[ð](#lib:round,time_point)

`template<class ToDuration, class Clock, class Duration>
  constexpr time_point<Clock, ToDuration> round(const time_point<Clock, Duration>& tp);
`

[7](#7)

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

*Constraints*: ToDuration is a specialization of duration, andtreat_as_floating_point_v<typename ToDuration​::​rep> is false[.](#7.sentence-1)

[8](#8)

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

*Returns*: time_point<Clock, ToDuration>(round<ToDuration>(tp.time_since_epoch()))[.](#8.sentence-1)
