[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting Yesterday's Date (Repost due to error)
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: Re: Getting Yesterday's Date (Repost due to error)
- From: naddy_(_at_)_mips_(_dot_)_inka_(_dot_)_de (Christian Weisgerber)
- Date: Tue, 31 May 2005 01:51:30 +0000 (UTC)
- Newsgroups: list.openbsd.misc
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
19981231
$ date -r $((915148821-86400)) +%Y%m%d
19981231
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
Visit your host, monkey.org