php中的延长时间[重复]

This question already has an answer here:

I have been searching for a while now regarding on how to format hours in php that will show 000:00:00 instead of 00:00:00.

I need this to calculate the duration of records with start and end Date with a datetime data type in mysql.

The problem with my current format ('H:m:s') is it only count 24 hours and when the duration goes higher than that, it will show 01:00:00 instead of 25:00:00.

</div>

Try TIMEDIFF() function in MySQL

Example:

SELECT TIMEDIFF('2008-12-31 23:59:59.000001',
             '2008-12-30 01:01:01.000002');
        -> '46:58:57.999999'