From d1a446687a9c1072c254beffceda1c4d724035bc Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 27 Aug 2020 09:37:25 -0700 Subject: xparsedate: support default date(1) output format. This round trip occurs in practice with $KBUILD_BUILD_TIMESTAMP in kernel builds. --- lib/xwrap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/xwrap.c b/lib/xwrap.c index 1bc929f1..cf7fc42a 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -967,6 +967,7 @@ void xparsedate(char *str, time_t *t, unsigned *nano, int endian) // Formats with seconds come first. Posix can't agree on whether 12 digits // has year before (touch -t) or year after (date), so support both. char *s = str, *p, *oldtz = 0, *formats[] = {"%Y-%m-%d %T", "%Y-%m-%dT%T", + "%a %b %e %H:%M:%S %Z %Y", // date(1) output format in POSIX/C locale. "%H:%M:%S", "%Y-%m-%d %H:%M", "%Y-%m-%d", "%H:%M", "%m%d%H%M", endian ? "%m%d%H%M%y" : "%y%m%d%H%M", endian ? "%m%d%H%M%C%y" : "%C%y%m%d%H%M"}; -- cgit v1.2.3