I\'ve got a shell script which does the following to store the current day\'s date in a variable \'dt\':
date \"+%a %d/%m/%Y\" | read dt
echo ${dt}
>
You have atleast 2 options
Use perl:
perl -e '@T=localtime(time-86400);printf("%02d/%02d/%02d",$T[4]+1,$T[3],$T[5]+1900)'
Install GNU date (it's in the sh_utils
package if I remember correctly)
date --date yesterday "+%a %d/%m/%Y" | read dt
echo ${dt}
Not sure if this works, but you might be able to use a negative timezone. If you use a timezone that's 24 hours before your current timezone than you can simply use date
.