I need to do date arithmetic in Unix shell scripts that I use to control the execution of third party programs.
I\'m using a function to increment a day and another
This works for me:
TZ=GMT+6; export TZ mes=`date --date='2 days ago' '+%m'` dia=`date --date='2 days ago' '+%d'` anio=`date --date='2 days ago' '+%Y'` hora=`date --date='2 days ago' '+%H'`