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
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
I'm sure you're able to compile and run GNU date on OpenBSD as well.
If not, then there is always Perl:
perl -e 'print scalar localtime(time - 24*60*60), "\n"'
Andreas
On 30/05/05, Timothy A. Napthali <[EMAIL PROTECTED]> wrote:
> In GNU Date land on Linux I was able to do this:
>
> Tim Napthal
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.
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).
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
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
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
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%
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
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
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 GNU Date land on Linux I was able to do this:
Tim Napthali
Private: +61 2 8920 8252
Mobile: +61 421 050 754
Email: [EMAIL PROTECTED]
IM (MSN): [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]>
"There are only 10 ki
13 matches
Mail list logo