如何计算两个date()之间的差异? [重复]

Possible Duplicate:
How to calculate the difference between two dates using PHP?

I have two time in this format: date("Y-m-d H:i:s"). How can I calculate different between these two time?

Try this:

<?php
    $datetime1 = date_create($start);
    $datetime2 = date_create($end);
    $interval = date_diff($datetime1, $datetime2);
    return $interval->format('%a'); //returns the number of days
?>

Use the DateTime class and the diff method.