in reply to Dates difference
Is that 45 days from this instant, from midnight last night or another point in the time that makes up a day?
The time function returns the number of seconds since the epoch. Fortunately the stat function you invoke does the same. So all you need to do is subtract the create date from now and see if it's greater than 45 days of seconds. So,
my $create_date = (stat(MLOG))10; my $now = time; # 45 days of seconds is 60*60*24*45 or 3888000 if(($now - $create_date) > 3888000) { #do whatever }
I'll leave the issue of needing to calculate the difference between last mid-night, noon, close of business or whatever erference point in the day as an exercise for the reader.
|
|---|