Burhan Khalid wrote:
BEOI 7308 wrote:

Hi

I want to substract $first_date to $second_date and print the result
this way :


xx days, xx hours, xx minutes

i tried (strtotime($second_date)-strtotime($first_date)) but what i
get is a timestamp and i dont know what to do with it


Is there already a function to print the result in a human readable
way ?


Thx


http://www.php.net/date


I'm not sure that helps too much. Subtracting unix timestamps will give the difference in seconds. You can then use division and remainders to calculate the hours, minutes and seconds.


Michael

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



Reply via email to