On Sun, Apr 8, 2018 at 10:54 PM, Robert Klein <rokl...@roklein.de> wrote:
> this works for me: > > date -r $(( $(date +%s) - 1 * 24 * 60 * 60 )) +%Y_%m_%d > Did you test that after 11pm on the day when daylight-saving time ends and the clock is turned back, resulting in a 25 hour long day? I would use this: perl -MPOSIX=strftime,mktime -le '@d=localtime(); $d[3]--; mktime(@d); print strftime("%Y_%m_%d",@d)' Philip Guenther