Get yesterday's date in bash on Linux, DST-safe
I think this should work, irrespective of how often and when you run it ...
date -d "yesterday 13:00" '+%Y-%m-%d'
date under Mac OSX is slightly different.
For yesterday
date -v-1d +%F
For Last week
date -v-1w +%F
This should also work, but perhaps it is too much:
date -d @$(( $(date +"%s") - 86400)) +"%Y-%m-%d"