I get a date value from an excel file and I change it to date like this
$dateEx = $sheet->getCellByColumnAndRow(2,$line)->getValue();
$date = date('Ymd',($dateEx - 25569)*24*60*60);
And I have 2 another date time that I convert from String to date
$dateOuverture = '20150306';
$dateFerm = '20150906';
$dateOuverture = new Datetime($dateOuverture);
$dateOuverture = $dateOuverture->format('Ymd');
$dateFerm = new Datetime($dateFerm);
$dateFerm = $dateFerm->format('Ymd');
and when I want to compare the date with an if it doesnt works
if($date<=$dateFerm && $date>=$dateOuverture){
echo "Im in the if";
}
what did I wrong?
Thanks for help