Correction date intervalle

This commit is contained in:
Michael RICOIS 2013-10-18 15:44:36 +00:00
parent 420ef2ca76
commit 9054d9a040

View File

@ -142,11 +142,13 @@ if ($stock) {
if ( $lastInsert && intval($nbMois)>0 ) { if ( $lastInsert && intval($nbMois)>0 ) {
Zend_Date::setOptions(array('extend_month' => true)); Zend_Date::setOptions(array('extend_month' => true));
$date = new Zend_Date($lastInsert, 'yyyyMMdd'); $date = new Zend_Date($lastInsert, 'yyyyMMdd');
$date->add($nbMois, Zend_Date::MONTH); $date->setTime('00:00:00')
->add($nbMois, Zend_Date::MONTH)
->subSecond(1);
$toInsert = $date->toString('yyyy-MM-dd'); $toInsert = $date->toString('yyyy-MM-dd');
echo date('Y/m/d - H:i:s') ." - jusqu'à : $toInsert".EOL; echo date('Y/m/d - H:i:s') ." - jusqu'au $toInsert".EOL;
} }
exit;
if ( $toInsert === null ) { if ( $toInsert === null ) {
$nbRows=$iDb->select('bilans','DISTINCT siren',"dateInsert>='$lastInsert' $strSirenReprise ORDER BY siren ASC", false, MYSQL_ASSOC, true); $nbRows=$iDb->select('bilans','DISTINCT siren',"dateInsert>='$lastInsert' $strSirenReprise ORDER BY siren ASC", false, MYSQL_ASSOC, true);
} else { } else {