To get yesterays date, execute the command :
TZ=aaa24 date +%Y%m%d
Output format will be yyyymmdd
To get yesterays date, execute the command :
TZ=aaa24 date +%Y%m%d
Output format will be yyyymmdd
What's the question??
Probably, "How do I do it reliably?"
The command as posted fails under various conditions.
However, I'm sure it has been answered here many times, and a search will find the answer.