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!news2.google.com!newsfeed.stanford.edu!news.kjsl.com!news-peer-lilac.gradwell.net!malatesta.hpl.hp.com!news-pa1.hpl.hp.com!not-for-mail From: "Banzai" Newsgroups: comp.unix.tru64 Subject: Re: using the tru64 date utility to present yesterdays date Date: Wed, 4 Jul 2007 10:04:25 +0100 Organization: HP Labs, Hewlett-Packard Company Message-ID: References: <1183466270.387710.95560@k79g2000hse.googlegroups.com> NNTP-Posting-Host: 16.27.161.182 X-Trace: news-pa1.hpl.hp.com 1183539871 10313 16.27.161.182 (4 Jul 2007 09:04:31 GMT) X-Complaints-To: usenet@news-pa1.hpl.hp.com NNTP-Posting-Date: Wed, 4 Jul 2007 09:04:31 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Xref: g2news1.google.com comp.unix.tru64:1007 wrote in message news:1183466270.387710.95560@k79g2000hse.googlegroups.com... > 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) > thanks - just what I need