From 63c5d6601626285e32456eebb26ee898dd968f0c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 2 Sep 2019 17:13:54 +0200 Subject: time/ISO8601: support omitting minutes --- src/time/ISO8601.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/time/ISO8601.cxx b/src/time/ISO8601.cxx index f4d0d5d38..b92a0e743 100644 --- a/src/time/ISO8601.cxx +++ b/src/time/ISO8601.cxx @@ -138,6 +138,8 @@ ParseISO8601(const char *s) precision = std::chrono::seconds(1); else if ((end = strptime(s, "%H:%M", &tm)) != nullptr) precision = std::chrono::minutes(1); + else if ((end = strptime(s, "%H", &tm)) != nullptr) + precision = std::chrono::hours(1); else throw std::runtime_error("Failed to parse time of day"); -- cgit v1.2.3