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

2005-06-01 Thread March, Harold W.
I use GNU gdate myself. Look for sh-utils in packages. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of MikeM Sent: Tuesday, May 31, 2005 8:54 AM To: Timothy A. Napthali; misc@openbsd.org Subject: Re: Getting Yesterday's Date (Repost d

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

2005-05-31 Thread MikeM
On 5/31/2005 at 8:22 AM Timothy A. Napthali wrote: |Sorry for previous version of this post. I sent it accidentally before I |was finished. | |In Linux I was able to do this: | |date +%Y%m%d -d "-1 day | |Which would give yesterdays date as 20050530 | |How can I do this in OpenBSD? I've mucked a

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

2005-05-31 Thread John Wright
On Tue, May 31, 2005 at 09:55:22AM +0200, Stoyan Genov wrote: > Does this work for you? > > shell$ TZ=GMT+24 date Wow! /me reads tzset(3) with interest.

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

2005-05-31 Thread Stoyan Genov
uesday, 31 May 2005 11:52 AM To: misc@openbsd.org Subject: Re: Getting Yesterday's Date (Repost due to error) Timothy A. Napthali <[EMAIL PROTECTED]> 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).

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

2005-05-30 Thread Timothy A. Napthali
Good point - I'll think I'll do it with perl, of get GNU Date. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christian Weisgerber Sent: Tuesday, 31 May 2005 11:52 AM To: misc@openbsd.org Subject: Re: Getting Yesterday's Date (Repo

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

2005-05-30 Thread Christian Weisgerber
Timothy A. Napthali <[EMAIL PROTECTED]> 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 $((91

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

2005-05-30 Thread Brett Lymn
On Mon, May 30, 2005 at 11:48:49PM +, Christian Weisgerber wrote: > > I don't think there is a reliable solution without something like > FreeBSD's -v or GNU's -d extensions. > If you only want yesterday then this should do (it is ugly but it has been tested on Solaris/Linux/NetBSD): #!/bin

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

2005-05-30 Thread Timothy A. Napthali
d.org Subject: Re: Getting Yesterday's Date (Repost due to error) 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 $((963000 )) +%Y%

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

2005-05-30 Thread Christian Weisgerber
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 $((963000 )) +%Y%m%d 20050328 $ date -r $((963000-86400)) +%Y%m%d 20050326 I don't think there is a r

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

2005-05-30 Thread Todd C. Miller
In message <[EMAIL PROTECTED]> so spake "Timothy A. Napthali" (timothya): > How can I do this in OpenBSD? I've mucked about with date -r $(expr > $(date +%d) - 86400) but I can't get it to work properly. In sh or ksh you could do: date -r $(( `date +%s` - 86400 )) +%Y%m%d - todd

Getting Yesterday's Date (Repost due to error)

2005-05-30 Thread Timothy A. Napthali
Sorry for previous version of this post. I sent it accidentally before I was finished. In Linux I was able to do this: date +%Y%m%d -d "-1 day Which would give yesterdays date as 20050530 How can I do this in OpenBSD? I've mucked about with date -r $(expr $(date +%d) - 86400) but I can't get