Hi i'm trying to make something that compares dates from my database to check if my license is expired.
My dates are stored in this format: 18/05/2019
(d/m/Y)
in my code i create a variable for today's date:
$TodayDate = Date('d/m/Y');
then i get the row that contains the date in my database like so:
$DBLicenseExpireDate = $row["LicenseExpireDate"];
and finally i try to see if the date is expired:
if ($TodayDate < $DBLicenseExpireDate) {
}
i've also tried:
if ($TodayDate < strtotime($DBLicenseExpireDate)) {
}
in almost all cases i tried it said it was expired while it was not.
I get some weird results. Example: If today's date is : 05/18/2019 and the expire date is: 06/06/2019 and i try this if statement:
if($todayDate < $expireDate)
{
echo 'not expired';
}
else
{
echo 'expired';
}
it still results as expired. seen million questions about checking expire dates, tried them all. I must be doing something wrong.