* using the tru64 date utility to present yesterdays date
@ 2007-07-02 14:24 Banzai
2007-07-03 12:37 ` nafc
0 siblings, 1 reply; 3+ messages in thread
From: Banzai @ 2007-07-02 14:24 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: using the tru64 date utility to present yesterdays date
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
0 siblings, 1 reply; 3+ messages in thread
From: nafc @ 2007-07-03 12:37 UTC (permalink / raw)
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: using the tru64 date utility to present yesterdays date
2007-07-03 12:37 ` nafc
@ 2007-07-04 9:04 ` Banzai
0 siblings, 0 replies; 3+ messages in thread
From: Banzai @ 2007-07-04 9:04 UTC (permalink / raw)
<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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-04 9:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox