Re: Date comparison

From: Date: Wed, 04 Feb 2004 10:53:02 +0000
Subject: Re: Date comparison
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-176778@lists.php.net to get a copy of this message
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

« previous php.general (#176778) next »