From d82f06896815991be88781c9a44857e2be9cea9f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 7 Jul 2023 20:57:48 +0200 Subject: format date in iso8601 --- crypt-expiry-check.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crypt-expiry-check.in b/crypt-expiry-check.in index c431099..14f7432 100755 --- a/crypt-expiry-check.in +++ b/crypt-expiry-check.in @@ -126,9 +126,11 @@ set_retcode() prints() { if echo "$4" | ${GREP} -qx '[0-9]\+'; then - MIN_DATE=$(${DATE} '+%b %d %Y' -d@$4) + MIN_DATE=$(${DATE} '+%F' -d@$4) + elif echo "$4" | ${GREP} -qx '[0-9]\+-[0-9]\+-[0-9]\+'; then + MIN_DATE=$(${DATE} '+%F' -d$4) else - MIN_DATE=$(echo $4 | ${AWK} '{ print $1, $2, $4 }') + MIN_DATE=$(date -d"$(echo $4 | ${AWK} '{ print $1, $2, $4 }')" +%F) fi if ${ISSUER} && ! ${VALIDATION} then -- cgit v1.2.3-70-g09d2