in reply to some problem with date
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: some problem with date
by Anonymous Monk on Apr 13, 2007 at 15:00 UTC | |
by ikegami (Patriarch) on Apr 13, 2007 at 15:30 UTC | |
by Anonymous Monk on Apr 16, 2007 at 10:21 UTC | |
by ikegami (Patriarch) on Apr 16, 2007 at 13:53 UTC | |
by Anonymous Monk on Apr 17, 2007 at 06:49 UTC | |
|