Time Help

From: Date: Sun, 01 Jul 2001 15:11:16 +0000
Subject: Time Help
Groups: php.general 
Request: Send a blank email to php-general+get-55729@lists.php.net to get a copy of this message
Hi, I`m trying to get the difference between two date/times and then state how many days, hours and minutes there are between them. So I take my date and convert it into unix time. Then get the current time, and then subtract the two to get the current difference in unix seconds. What I`m having trouble doing is working out how many days hours and minutes are left over. For example if I have the date/time: 2001-07-01 01:10:00 And the current date/time was: 2001-07-02 00:00:00 Then I would like to display 1 Day 1 Hour 10 Minutes. Any one have any suggestions, this is my code so far. $date1_formated = "$DateEnd $TimeEnd"; $date1 = strtotime($date1_formated); //converts to a UNIX timestamp $date2 = time(); //returns current UNIX timestamp $seconds_between = $date1 - $date2; TIA Ade

« previous php.general (#55729) next »