Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Subtract dates
March 8, 2005, 1:43 am
rate this thread
$expirationdate = 4/15/2005
$startdate = 3/1/2005
I would like to determine the number of days between the above dates.
$startdate = strtotime($startdate); // change to a string
$expirationdate = strtotime($expirationdate);
$delta = $expirationdate - $startdate; // $delta = 1110175200
How do I convert $delta to only number of days? // number of days should
equal 45 days
Do I need to convert the dates to strings to subtract them?