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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -