HI! I have two dates, one in the future, and the current date, I want to calculate the difference between the two in # of days. I have converted both dates to seconds:

future date:
<?$maturity_date = mktime (0,0,0,$mday_row[3],$mday_row[2],$mday_row[5]);?>
current date:
<?$today = getdate();?>
<?$now_date = mktime (0,0,0,$today['month'],$today['wday'],$today['year']);?>

Then I found the difference between the two:
<?$difference_date = ($maturity_date - $now_date);?>

Now I want to convert the difference to "days":
<?$difference_days = ($difference_date / 86400);?>
(24 [hours in a day] * 60 [minutes in an hour] * 60 [seconds in a minute] = 86400)

This seems to make sense to me, but I don't get the answer I want. As a test I start with a date 14 days in the future, so I should come out with an answer of 14, but it comes out as 3!

Please help this shoudln't be a big enough problem to throw me off schedule.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to