tags:

views:

30

answers:

1

Following command converts date formated as MM/DD/YYYY to seconds.

date -d "01/21/2014" +%s

How can I convert DD/MM/YYYY formated date to seconds?

Thanks

A: 
date -j -f "%d/%m/%Y" "DD/MM/YYYY" "+%s"
Alan Horn
date: invalid option -- 'j'
baltusaj
Depending on your OS, the -j may not be needed. Try without, but do not try as root, in case you accidentally set the date on your machine :)
Alan Horn