days, date('Y')); $end = mktime(0, 0, 0, date('m'), date('d'), date('Y')); //echo date('Y-m-d H:i:s', $start), "\n"; //echo date('Y-m-d H:i:s', $end), "\n"; foreach (scandir($dir) as $file) { if ($file == '.' || $file == '..' || substr($file,0,1) == '.') continue; $filename = $dir . '/' . $file; if (is_dir($filename)) { $this->scanDir($filename); continue; } $lastmod = filemtime($filename); // echo date('Y-m-d H:i:s', $lastmod), "\n"; if ($lastmod >= $start && $lastmod < $end) { //$this->mark($filename); //@touch($filename, $lastmod); echo date('Y-m-d H:i:s', $lastmod), "\n"; echo $filename, "\n"; } } } public function actionAdd($days=1) { $this->days = (int)$days; $uploads = realpath(Yii::getPathOfAlias('application') . '/../uploads'); $start = mktime(0, 0, 0, date('m'), date('d') - $this->days, date('Y')); $end = mktime(0, 0, 0, date('m'), date('d'), date('Y')); echo date('Y-m-d H:i:s', $start), "\n"; echo date('Y-m-d H:i:s', $end), "\n"; $this->scanDir($uploads); } }