[core] move from microsecond precision timestamp to integer second precision

This commit is contained in:
Konstantin Käfer
2016-05-13 15:41:22 +02:00
parent c1dde52c73
commit cd65a43855
26 changed files with 123 additions and 93 deletions

View File

@@ -25,12 +25,8 @@ CacheControl CacheControl::parse(const std::string& value) {
return result;
}
optional<SystemTimePoint> CacheControl::toTimePoint() const {
// Round trip through time_t to truncate fractional seconds.
return maxAge
? SystemClock::from_time_t(SystemClock::to_time_t(
SystemClock::now() + std::chrono::seconds(*maxAge)))
: optional<SystemTimePoint>();
optional<Timestamp> CacheControl::toTimePoint() const {
return maxAge ? util::now() + Seconds(*maxAge) : optional<Timestamp>{};
}
} // namespace http