develooper Front page | perl.beginners | Postings from April 2002

Backing up two days from localtime

Thread Next
From:
Tara Calishain
Date:
April 25, 2002 22:56
Subject:
Backing up two days from localtime
Message ID:
5.1.0.14.2.20020426015405.01e71c60@pop.mindspring.com
Howdy,

I need to back up two days from localtime and I can't figure out how to do
it. Currently I'm doing this just so I can work out the rest of the program:

($day, $month, $year) = (localtime) [3,4,5]; #getting your local time 
information
$realday = $day-2;
if ($realday<1) {$realday = 30} else {$realday = $day-2};

.... but that's a very cheesy and occasionally wrong workaround.

This is probably a stupid question hopefully not the stupidest question 
you've ever
seen. I hope.

Thanks,

Tara


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About