[EMAIL PROTECTED] wrote:
> Well its not much different than what was posted below, here it is :
> 
> my $ctime = (stat $test)[10]; # or mtime is 9
> my $age = (time - $ctime) / 86400;
> 
> The file date is Sep  2 07:46 and this code tells me it is 11935.3388425926
> days old!?

The display time is probably modification not - not creation time.
Switch to mtime (9) and you should get better results:

my $filename = 'whateve';
my $mtime = (stat $filename)[9];                # or ctime is 10
my $time = time;                                # broke time out to print
my $age = int (($time - $mtime) / 86400);       # did int to drop fraction
print "time=$time, mtime=$mtime, age=$age\n";

-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to