absl::ToChronoTime

Converts an absl::Time to a std::chrono::system_clock::time_point. If overflow would occur, the returned value will saturate at the min/max time point value instead.

Synopsis

Declared in <absl/time/time.h>

std::chrono::system_clock::time_point
ToChronoTime(Time t);

Description

Example:

absl::Time t = absl::FromTimeT(123); auto tp = absl::ToChronoTime(t); // tp == std::chrono::system_clock::from_time_t(123);

Return Value

The equivalent system-clock time point.

Parameters

NameDescription
tThe time to convert.