summaryrefslogtreecommitdiff
path: root/include/mbgl/util/chrono.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-01-19 18:32:33 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-01-22 18:41:54 -0800
commitcef5c331fe6ab827e71aed1e4e0387983083c88e (patch)
tree47c71da0e81f25678640032d5708212ef022072e /include/mbgl/util/chrono.hpp
parent5cd123422ed026912c53c44a393f141f990a09df (diff)
downloadqtlocation-mapboxgl-cef5c331fe6ab827e71aed1e4e0387983083c88e.tar.gz
[core] Merge rfc1123, iso8601, and parse_date into chrono.hpp and fix their API
Diffstat (limited to 'include/mbgl/util/chrono.hpp')
-rw-r--r--include/mbgl/util/chrono.hpp13
1 files changed, 13 insertions, 0 deletions
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 <chrono>
+#include <string>
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