diff options
author | Erich Eckner <git@eckner.net> | 2023-07-07 20:57:48 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2023-07-07 20:57:48 +0200 |
commit | d82f06896815991be88781c9a44857e2be9cea9f (patch) | |
tree | e7527898b746f767ebd7f4e7ce3bacb8f9daa315 /crypt-expiry-check.in | |
parent | 6d3588a0adb678ea4c4649d89ff6c2e1e0e9b100 (diff) | |
download | crypt-expiry-check-d82f06896815991be88781c9a44857e2be9cea9f.tar.xz |
format date in iso8601
Diffstat (limited to 'crypt-expiry-check.in')
-rwxr-xr-x | crypt-expiry-check.in | 6 |
1 files 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 |