This is working for Linux
main idea find the seconds since "00:00:00 1970-01-01 UTC"
then subtract them. This is GNU extension.
$ a=$(date -d "Tue Apr 29 14:02:19 PDT 2003" +%s)
$ b=$(date -d "Tue Apr 05 14:02:19 PDT 2003" +%s)
$ d=$(( $a - $b ))
$ echo $(( $d / 3600 / 24 ))
Monday, 14 July 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment