File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1811,6 +1811,10 @@ _time() {
18111811# 2022-04-01 08:10:33 to 1648800633
18121812# or 2022-04-01T08:10:33Z to 1648800633
18131813_date2time () {
1814+ # Mac/BSD
1815+ if date -u -j -f " %Y-%m-%d %H:%M:%S" " $( echo " $1 " | tr -d " Z" | tr " T" ' ' ) " +" %s" 2> /dev/null; then
1816+ return
1817+ fi
18141818 # Linux
18151819 if date -u -d " $( echo " $1 " | tr -d " Z" | tr " T" ' ' ) " +" %s" 2> /dev/null; then
18161820 return
@@ -1820,10 +1824,6 @@ _date2time() {
18201824 if gdate -u -d " $( echo " $1 " | tr -d " Z" | tr " T" ' ' ) " +" %s" 2> /dev/null; then
18211825 return
18221826 fi
1823- # Mac/BSD
1824- if date -u -j -f " %Y-%m-%d %H:%M:%S" " $( echo " $1 " | tr -d " Z" | tr " T" ' ' ) " +" %s" 2> /dev/null; then
1825- return
1826- fi
18271827 # Omnios
18281828 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
18291829 return
You can’t perform that action at this time.
0 commit comments