I know the command is date +%s -d "xxx"
But how do I convert 11/03/2018 02:44:58
to epoch ?
root@AngelBeats:~# date +%s -d "11/03/2018 02:44:58"
date: invalid date '11/03/2018 02:44:58'
Edit: For Linux
date --date="11/03/2018 8:15:00" +"%s"
1520736300
This should do it.(For OSX Systems)
date -j -f "%d/%m/%Y %H:%M:%S" "11/03/2018 8:15:00" +"%s"
1520736300
The "-f" specifier can be used to set the format.
-j
is for BSD systems. On Linux, use this:
date -d "11/03/2018 8:15:00" +"%s"