using the tru64 date utility to present yesterdays date
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix True 64 > using the tru64 date utility to present yesterdays date




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    using the tru64 date utility to present yesterdays date  
Banzai


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-02-07 06:20 PM

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







[ Post a follow-up to this message ]



    Re: using the tru64 date utility to present yesterdays date  
nafc@snet.net


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-03-07 06:22 PM

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)






[ Post a follow-up to this message ]



    Re: using the tru64 date utility to present yesterdays date  
Banzai


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-04-07 12:20 PM


<nafc@snet.net> wrote in message
news:1183466270.387710.95560@k79g2000hse.googlegroups.com...
> On Jul 2, 10:24 am, "Banzai" <ban...@aaa.com> wrote: 
>
> 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







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:47 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register