fix for DragonflyBSD
just move "date -u -j -f" before the linux branch.pull/6503/head
parent
e06cdbf0ac
commit
39cb87dc4b
8
acme.sh
8
acme.sh
|
@ -1811,6 +1811,10 @@ _time() {
|
|||
# 2022-04-01 08:10:33 to 1648800633
|
||||
#or 2022-04-01T08:10:33Z to 1648800633
|
||||
_date2time() {
|
||||
#Mac/BSD
|
||||
if date -u -j -f "%Y-%m-%d %H:%M:%S" "$(echo "$1" | tr -d "Z" | tr "T" ' ')" +"%s" 2>/dev/null; then
|
||||
return
|
||||
fi
|
||||
#Linux
|
||||
if date -u -d "$(echo "$1" | tr -d "Z" | tr "T" ' ')" +"%s" 2>/dev/null; then
|
||||
return
|
||||
|
@ -1820,10 +1824,6 @@ _date2time() {
|
|||
if gdate -u -d "$(echo "$1" | tr -d "Z" | tr "T" ' ')" +"%s" 2>/dev/null; then
|
||||
return
|
||||
fi
|
||||
#Mac/BSD
|
||||
if date -u -j -f "%Y-%m-%d %H:%M:%S" "$(echo "$1" | tr -d "Z" | tr "T" ' ')" +"%s" 2>/dev/null; then
|
||||
return
|
||||
fi
|
||||
#Omnios
|
||||
if python3 -c "import datetime; print(int(datetime.datetime.strptime(\"$1\", \"%Y-%m-%d %H:%M:%S\").replace(tzinfo=datetime.timezone.utc).timestamp()))" 2>/dev/null; then
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue