Good Day
I am selecting date from datepicker and after adding one year, it generates expire date, which is correct But when I echo it shows Active on wrong date and expired on wrong date like on 27-04-2021 its expiry will be in 27-04-2022 but it shows active, it should show expired Please help
Code Below
<?php
$status = "";
if (isset($_POST['submit']))
{
$id=$_REQUEST['id'];
//$trn_date = date("Y-m-d H:i:s");echo '<br />';
$approvedate =$_POST['approvedate'];echo '<br />';
$today =date("d-m-Y");echo '<br />';
$expiredate=date('d-m-Y',strtotime('+1 year', strtotime($approvedate)));
if($today>$expiredate)
{
echo 'Expired';}
else
{
echo 'Active';}
}
?>
$approvedate is a value from datepicker.