From 339c85b37d5d946fa88c9ba81bad6dc3b45ce069 Mon Sep 17 00:00:00 2001 From: Benson Margulies Date: Mon, 23 Nov 2015 13:02:50 -0500 Subject: [PATCH] work around macosx date limitation. --- docker-gc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-gc b/docker-gc index 44381ea..14ef9d6 100755 --- a/docker-gc +++ b/docker-gc @@ -83,8 +83,12 @@ function date_parse { # GNU/date echo $(date -u --date "${1}" "+%s") else + if [ "${1}" == "0001-01-01 00:00:00" ] ; then # avoid + echo $(date -j -u -f "%F %T" "2001-01-01 00:00:00" "+%s") + else # BSD/date - echo $(date -j -u -f "%F %T" "${1}" "+%s") + echo $(date -j -u -f "%F %T" "${1}" "+%s") + fi fi }