php - If Stored Date is Greater Than So Many Months Then -
problem:
if stored date ($stored_date) (yyyy-mm-dd) greater time (2 months) something...
code have tried:
if(strtotime($stored_date) + strtotime('+2 month') <= strtotime('now')) { // something... } else { // something... }
however, not working me. appreciated. thanks.
$date = new datetime($stored_date); $date->add(new dateinterval('p2m')); $now = new datetime(); if ($date > $now) { }
Comments
Post a Comment