I have a table that contains expiry dates for software modules. They are stored as type varchar(32). The database also stores dates one month prior to expiry and one day prior to expiry. When a license is approaching expiry the client is notified by message stack when they go into site admin.
What i want is to be able to edit the expiry date so that additional months or even years can be added to a clients license. The issue is that it also needs to update the other dates relative to the new expiry or they will get warnings when they shouldn't.
So field 'edate' contains a date stored as 25-10-2015, 'wdate' contains 25-09-2014 and 'fwdate' contains 24-10-2015
How do you take the date stored in the db and make it usable with code as seen below which originally calculated the dates.
$todays_date = strtotime("now");
$delta_eleven = strtotime("+11 months");
$delta_364 = strtotime("+1 year -1 day");
$delta_year = strtotime("+1 year");
$idate = date("d-m-Y", $todays_date);
$wdate= date("d-m-Y", $delta_eleven);
$fwdate = date("d-m-Y", $delta_364);
$edate = date("d-m-Y", $delta_year);