time/ISO8601: support omitting minutes
This commit is contained in:

committed by
Max Kellermann

parent
d09bd9178f
commit
63c5d66016
@@ -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");
|
||||
|
||||
|
Reference in New Issue
Block a user