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 due
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).
Be very, very careful
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.
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
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
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
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%m%d
20050328
$ date -r $((963000
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/sh
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
9 matches
Mail list logo