Windows Time modification 12/31/1969???
| From: | Joe | Date: | Fri, 02 Feb 2001 20:14:16 +0000 |
| Subject: | Windows Time modification 12/31/1969??? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-37895@lists.php.net to get a copy of this message | ||
I'm opening the files in a directory, and trying to find the most
recent modification date. The problem is that I'm getting the date
of 12/31/1969 for all my files, and when I try to print out the modification
timestamp from filemtime directly I get nothing.
If you look at the code you can see. Nothing is printed out at print
$fileDate.
It is a windows NT system could this be the problem. Having troubles
with the UNIX timestamp?
while (false!=($file = readdir($handle))) { // read all files in dir
if ($file != "." && $file != "..") { // only if file is not . or ..
$fileDate = filemtime($file); // get date from file
$newDate = filemtime($newFile); // get date from newFile
print $fileDate;
if ($newDate < $fileDate) { // if file is newer
$newFile = $file; // replace newFile with newer file
}
}
}