I had to do that recently.
FWIW ... i wrote some Date::Calc code and decided to use the above code instead.use Time::Local; my $now = timelocal(localtime); my $mtime = (stat $file)[9]; my $delta = ($now - $mtime) / (60 * 60 * 24);
UPDATE: Corion to the rescue again. :) (That means i learned something too. Yes ... -C works fine, in fact, it works better than fine. I just wish i knew about that last week when i wasted 10 minutes writing that snippet. ;))
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Dates difference
by jeffa
in thread Dates difference
by gl2103
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |