Skip to content

std::time - Time-of-day helper functions.

func to_duration

func to_duration(Time): Duration

Converts a Time (time-of-day) into a Duration from midnight.

func diff

func diff(Time, Time): Duration

Computes the signed duration from b to a (a - b). The result may be negative.

func add

func add(Time, Duration): Time

Adds a Duration to a Time, wrapping within [0, 24h).

func sub

func sub(Time, Duration): Time

Subtracts a Duration from a Time, wrapping within [0, 24h).