Todd C. Miller <[EMAIL PROTECTED]> wrote:

> In sh or ksh you could do:
>     date -r $(( `date +%s` - 86400 )) +%Y%m%d

This can return unexpected results.

$ export TZ=CET
$ date -r $((1111963000      )) +%Y%m%d
20050328
$ date -r $((1111963000-86400)) +%Y%m%d
20050326

I don't think there is a reliable solution without something like
FreeBSD's -v or GNU's -d extensions.

-- 
Christian "naddy" Weisgerber                          [EMAIL PROTECTED]

Reply via email to