Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: "Banzai" <banzai@aaa.com>
Subject: Re: using the tru64 date utility to present yesterdays date
Date: Wed, 4 Jul 2007 10:04:25 +0100	[thread overview]
Message-ID: <f6fnqv$a29$1@news-pa1.hpl.hp.com> (raw)
In-Reply-To: 1183466270.387710.95560@k79g2000hse.googlegroups.com


<nafc@snet.net> wrote in message 
news:1183466270.387710.95560@k79g2000hse.googlegroups.com...
> On Jul 2, 10:24 am, "Banzai" <ban...@aaa.com> wrote:
>> Hello
>>
>> The implementation of date in linux has a -d flag to present yesterdays
>> date.
>>
>> For instance
>>
>> # date +"%Y-%m-%d"
>> 2007-07-02
>> # date +"%Y-%m-%d" -d yesterday
>> 2007-07-01
>>
>> Is there something similar for tru64 ?? as it doesn't seem to support 
>> the -d
>> flag
>
> Try this:
>
> #!/bin/ksh -vx
>
> localtime=$(date +%H)
> utc=$(date -u +%H)
>
> offset=$(($utc - $localtime))
> today=$(TZ="EST${offset}EDT${offset}" date)
>
> offset=$(($offset + 24))
> yesterday=$(TZ="EST+${offset}EDT+${offset}" date)
>

thanks - just what I need 




      reply	other threads:[~2007-07-04  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-02 14:24 using the tru64 date utility to present yesterdays date Banzai
2007-07-03 12:37 ` nafc
2007-07-04  9:04   ` Banzai [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox