From: nafc@snet.net
Subject: Re: using the tru64 date utility to present yesterdays date
Date: Tue, 03 Jul 2007 05:37:50 -0700 [thread overview]
Message-ID: <1183466270.387710.95560@k79g2000hse.googlegroups.com> (raw)
In-Reply-To: <f6b1q3$286$1@news-pa1.hpl.hp.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)
next prev parent reply other threads:[~2007-07-03 12:37 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 [this message]
2007-07-04 9:04 ` Banzai
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