I have a column in the database that is in DATE (Y-m-d)
format.
In the php code I retrieve this string and I have to compare it with the current date and this is the condition I'm using:
$dtEntrega=date("Y-m-d",strtotime($row["dtEnterga"]));
$today = strtotime(date("Y-m-d"));
if($today>=$dtEntrega){
//Fazer algo
}
But this code always returns true, even if the delivery date is stored in the database with date in the future. Does anyone know where I'm going wrong or is something missing?
Edition: The question is not the same as the one quoted by the moderator because the result of that does not apply to my context.