Re: date command two days from now



As much as I love Perl, I have a cool little date trick for you...

NEXTDATE=$(TZ=CST-42CDT date +%Y%m%d)

1. Echo your $TZ - in my case I got CST6CDT
2. Subtract (subtract for forward, add for backward) 48 from your timezone
offset
3. Adjust as needed.



Steve





Enrique Sanchez
Vela To: aix-l@xxxxxxxxxxxxx
<esanchezvela@YAH cc:
OO.COM> Subject: Re: date command two days from now
Sent by: IBM AIX
Discussion List
<aix-l@Princeton.
EDU>


01/23/2007 06:52
PM
Please respond to
IBM AIX
Discussion List





I would use perl,

perl -e ' $string=localtime( time()+48*3600),print
"$string \n"'
Thu Jan 25 18:52:05 2007


regards,
esv.

--- Andrew.Townsend@xxxxxxxxx wrote:

Is there a way to get the date from say two days
from now or two hours from
now for scripting purposes?

I mean like:

date +"%d %h %y" gives you 23 Jan 07

But I want

23 Jan 07

Or instead of "Tuesday" I'm looking for "Thursday".


Any ideas?

Thanks,



Enrique Sanchez Vela
email: esanchezvela@xxxxxxxxx
--------------------------------------
http://www.savetheinternet.com/



____________________________________________________________________________________

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com



Relevant Pages

  • Bot::BasicBots forkit() creating zombies
    ... First of all I'd like to tell you all that I'm a total Perl newbie, ... Bot::BasicBot's forkit() method to run for example a Yahoo! ... my $message = shift; ...
    (comp.lang.perl.misc)
  • Summary: array in ksh
    ... IFS environment variable to a newline. ... Ilhan Narili ... Some suggested that I use perl. ... Do you Yahoo!? ...
    (SunManagers)
  • Re: is there the simplest way to do this: logon to my email account and delete bulk emails?
    ... Google search along the lines of "CPAN yahoo mail". ... you could indeed get the job done with a few lines of Perl. ... this newsgroup was a perfectly good forum for sketching ...
    (comp.lang.perl.misc)
  • Re: perl
    ... I am sure about it shows very clear in error message The system cannot find the path ... Subject: perl ... I am using apache 2.0.04 win32 version in window XP, ... Have a HUGE year through Yahoo! ...
    (perl.beginners)
  • Re: how to print " time " ???
    ... I wonder why perldoc works on my installation of Activestate perl when it ... > Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)