time/ISO8601: don't use glibc extension in strptime.

Per the manual for strptime, %F is equivalent %Y-%m-%d, so use that
directly.
This commit is contained in:
Érico Rolim
2021-02-25 13:53:31 -03:00
committed by Max Kellermann
parent c95e3dc065
commit 8d80280ab9
2 changed files with 3 additions and 1 deletions

View File

@@ -185,7 +185,7 @@ ParseISO8601(const char *s)
struct tm tm{};
/* parse the date */
const char *end = strptime(s, "%F", &tm);
const char *end = strptime(s, "%Y-%m-%d", &tm);
if (end == nullptr) {
/* try without field separators */
end = strptime(s, "%Y%m%d", &tm);