[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: "Timothy A. Napthali" <timothya_(_at_)_napthali_(_dot_)_com>
- Date: Tue, 31 May 2005 12:30:54 +1000
- Thread-index: AcVlhGbKf77B7igOSJSNn6tV3ibVqQABEDEg
- Thread-topic: Getting Yesterday's Date (Repost due to error)
Good point - I'll think I'll do it with perl, of get GNU Date.
-----Original Message-----
From: owner-misc_(_at_)_openbsd_(_dot_)_org [mailto:owner-misc_(_at_)_openbsd_(_dot_)_org] On Behalf
Of Christian Weisgerber
Sent: Tuesday, 31 May 2005 11:52 AM
To: misc_(_at_)_openbsd_(_dot_)_org
Subject: 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
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