if($fileAgeInDays = $yesterday)
That should be == instead of =.
my($fileAgeInDays) = ((time() - (stat($eachFile))[9]) / 24 / 60 / 60);
incorrectly assumes all days are 24*60*60 seconds long.
my($fileAgeInDays) = ((time() - (stat($eachFile))[9]) / 24 / 60 / 60);
returns an incorrect answer when the time of day of the file modification time is less than today's time of day. For example, if today started 10 hours ago and the file was modified 20 hours ago, the file was created yesterday, but $fileAgeInDays is 0.
Update: Changed the layout for readability, but not the content.
In reply to Re: some problem with date
by ikegami
in thread some problem with date
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |