How to compare - One month
Posted: Fri Jul 03, 2009 3:46 pm
I just want to know is the database date, One month old or not?
How to minus 1 month
Please tell me how to calculate minus 1 month.
Or
any other way to compare 1 month (One month old or not).
Code: Select all
$todt = date("Y-m-d"); //Today
$dbdt = date("Y-m-d", strtotime($row["date"]));//Database date
Code: Select all
$expiry = $todt - one month;Code: Select all
if ($expiry > $today) {
$new_status = "Expire";
} else {
$new_status = "ok";
}Or
any other way to compare 1 month (One month old or not).