I need to do some date manipulation in ksh. For instance I need to get
yesterdays date. Can someone tell me how I can accomplish this? I have
looked through a couple of manuals and web pages, and can't seem to find
anything.
Please respond to kevin_...@timeinc.com as well as the group.
Thanks,
Kevin
man date - to find out more
<kevin_...@timeinc.com> wrote in message
news:3a350eb3$0$1...@wodc7nh6.news.uu.net...
Did you search through the comp.unix.shell archives too?
Depending on your version of date you can use:
date --d="yesterday"
to give yesterdays date.
Tristan.
A lot of people will recommend fiddling with the TZ settings, and a
equal # will advise aganst that. I use the GNU version of 'date' when
I possibly can. With it you can do funky things like:
$ date -d yesterday
$ date -d '2 days ago'
$ date -d '5 months 3 days' # in the future
If you don't already know, check out your version of date:
$ date --version
And if you already have it, check 'man date'.
--
thks.jeff
Sent via Deja.com http://www.deja.com/
Before you buy.
-----------------------------------------------------------------
opinions are not of my employer, but of myself.
-----------------------------------------------------------------