From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fa528,123179f27fb1f2a7 X-Google-Attributes: gidfa528,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!k79g2000hse.googlegroups.com!not-for-mail From: nafc@snet.net Newsgroups: comp.unix.tru64 Subject: Re: using the tru64 date utility to present yesterdays date Date: Tue, 03 Jul 2007 05:37:50 -0700 Organization: http://groups.google.com Message-ID: <1183466270.387710.95560@k79g2000hse.googlegroups.com> References: NNTP-Posting-Host: 149.152.14.138 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1183466270 13792 127.0.0.1 (3 Jul 2007 12:37:50 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 3 Jul 2007 12:37:50 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: k79g2000hse.googlegroups.com; posting-host=149.152.14.138; posting-account=eqwQww0AAABL8L1FP5yaWaQ6fmggVs3h Xref: g2news1.google.com comp.unix.tru64:1006 On Jul 2, 10:24 am, "Banzai" 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)