summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-07-07 20:57:48 +0200
committerErich Eckner <git@eckner.net>2023-07-07 20:57:48 +0200
commitd82f06896815991be88781c9a44857e2be9cea9f (patch)
treee7527898b746f767ebd7f4e7ce3bacb8f9daa315
parent6d3588a0adb678ea4c4649d89ff6c2e1e0e9b100 (diff)
downloadcrypt-expiry-check-d82f06896815991be88781c9a44857e2be9cea9f.tar.xz
format date in iso8601
-rwxr-xr-xcrypt-expiry-check.in6
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