From cef5c331fe6ab827e71aed1e4e0387983083c88e Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 19 Jan 2016 18:32:33 -0800 Subject: [core] Merge rfc1123, iso8601, and parse_date into chrono.hpp and fix their API --- include/mbgl/util/chrono.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/mbgl/util/chrono.hpp') diff --git a/include/mbgl/util/chrono.hpp b/include/mbgl/util/chrono.hpp index ce005485bc..dd228df977 100644 --- a/include/mbgl/util/chrono.hpp +++ b/include/mbgl/util/chrono.hpp @@ -2,6 +2,7 @@ #define MBGL_UTIL_CHRONO #include +#include namespace mbgl { @@ -42,6 +43,18 @@ Milliseconds toMilliseconds(std::chrono::time_point<_Clock, _Duration> time_poin return asMilliseconds(toDuration<_Clock, _Duration>(time_point)); } +namespace util { + +// Returns the RFC1123 formatted date. E.g. "Tue, 04 Nov 2014 02:13:24 GMT" +std::string rfc1123(SystemTimePoint); + +// YYYY-mm-dd HH:MM:SS e.g. "2015-11-26 16:11:23" +std::string iso8601(SystemTimePoint); + +SystemTimePoint parseTimePoint(const char *); + +} // namespace util + } // namespace mbgl #endif -- cgit v1.2.1