$sql = "SELECT * FROM {$modx->getTableName('modResource')} WHERE `editedon` < ".strtotime('2000-02-24 00:00:00')." LIMIT 1000"; $q = new xPDOCriteria($modx, $sql); $docs = $modx->getCollection('modResource', $q); echo '<pre>'; $i=1; foreach($docs as $doc){ $dat = $doc->get('editedon'); $content = $doc->get('pagetitle'); echo $i.' '.$content.' '.$dat.' '.strtotime($dat); echo "\n"; $i=$i+1; //$doc->set('editedon','2017-02-23 00:00:00'); //$doc->save(); } echo '</pre>';