I searched right here and found a workaround for comparing dates, but for me it is not working at strtotime
$dataVencimento = date("d/m/Y", strtotime($dados->VENCIMENTO));
$dataAtual = date("d/m/Y");
echo $dataAtual;
if(strtotime($dataVencimento) < strtotime($dataAtual))
{
$situacao = "<span class='label label-danger'>VENCIDO</span>";
}
The value of dataVencimento
is 9/15/2018 and dataAtual
is 18/09/2018, so it is smaller and should enter if
, but it does not enter.