diff options
-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 |