I want to subtract \"number of days\" from a date in bash. I am trying something like this ..
echo $dataset_date #output is 2013-08-07 echo $date_diff #outp
Here is my solution:
echo $[$[$(date +%s)-$(date -d "2015-03-03 00:00:00" +%s)]/60/60/24]
It calculates number of days between now and 2015-03-03 00:00:00