Posted 05 July 2006 - 07:43 PM
i tried and get an answer of 0. How can i convert the date into a number?
So basically I will have two dates, Todays date and a date stored in a database that I will retrieve Do the math and if the difference is 0-30 i do nothing, 30-34 i do one thing, 60-64 i do another another and greater than 64 i do nothing.
$date1 = date("Y-m-d");
$date2 = date("Y-m-d", strtotime("+2 days"));
$date_diff = $date2 - $date1;
Posted 05 July 2006 - 07:58 PM
Your example would then be:
<?php $date1 = time(); $date2 = strtotime("+2 days"); $date_diff = floor(($date2 - $date1)/86400); echo $date_diff; ?>
Posted 05 July 2006 - 08:28 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users