[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting Yesterday's Date (Repost due to error)

Timothy A. Napthali <timothya_(_at_)_napthali_(_dot_)_com> wrote:

> It should be safe. All my mail servers run GMT to prevent log confusion
> (ie: It's a given that any log time is always GMT). 

Be very, very careful.

$ export TZ=right/GMT
$ date -r $((915148821      )) +%Y%m%d            
$ date -r $((915148821-86400)) +%Y%m%d

There is probably a Perl module around that can handle this sort
of calculation in a more robust manner.

Christian "naddy" Weisgerber                          naddy_(_at_)_mips_(_dot_)_inka_(_dot_)_de