readdir doesn't put the directory name on what it returns, so when you call stat you're not getting any results (and hence $mtime is undef and localtime will return the epoch). You need to do stat( "$dir/$file" ) instead, or change your working directory to $dir.
In reply to Re: Getting file properties returns 1970 modify time
by Fletch
in thread Getting file properties returns 1970 modify time
by NarendraTTT
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |