diff options
Diffstat (limited to 'src/mbgl/util/http_header.cpp')
-rw-r--r-- | src/mbgl/util/http_header.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mbgl/util/http_header.cpp b/src/mbgl/util/http_header.cpp index cfc43991b7..dceb331a3f 100644 --- a/src/mbgl/util/http_header.cpp +++ b/src/mbgl/util/http_header.cpp @@ -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 |