23 const std::string& timestring,
24 const std::string& format
26 using TimePoint = std::chrono::time_point<std::chrono::system_clock, Duration>;
31 cctz::time_point<cctz::seconds> tp_seconds;
32 cctz::detail::femtoseconds femtoseconds;
33 if (!cctz::detail::parse(format, timestring, cctz::utc_time_zone(), &tp_seconds, &femtoseconds)) {
38 if (std::chrono::time_point_cast<Days>(tp_seconds) >= kTaxiInfinity ||
39 tp_seconds > std::chrono::time_point_cast<
decltype(tp_seconds)::duration>(TimePoint::max()))
41 return TimePoint::max();
44 return std::chrono::time_point_cast<Duration>(tp_seconds) + std::chrono::duration_cast<Duration>(femtoseconds);