Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time in Perl

Status
Not open for further replies.

fergmj

Programmer
Feb 21, 2001
276
US
I have a $filedate that displays as Feb 12, 2002, 15:32

I want to find a way to say if $filedate is greater than 48 hours old, then .....

How do I do this?

Thanks

Mindy
 
$time = localtime(time);
...
...
if ($time < localtime(time)-60*60*48){
...
}

? perldoc Date::Calc ?
 
You could also use the file operator -M on the file. -M is how old (in days) a file is since it's last modification.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top