Re: Time Help

From: Date: Sun, 01 Jul 2001 15:22:24 +0000
Subject: Re: Time Help
Groups: php.general 
Request: Send a blank email to php-general+get-55733@lists.php.net to get a copy of this message
Thanks Jeff, Thats just the job. Ade << Here is the function I use when I am comparing differences ($now and $old are Unix timestamps): function datediff($now, $old) { $DIS = $now - $old; // Diff In Secs $secs = $DIS % 60; // modulo $DIS -= $secs; $days = floor($DIS / (24*60*60)); $DIS -= $days * (24*60*60); $hours = floor($DIS / (60*60)); $DIS -= $hours * (60*60); $mins = floor($DIS / 60); $DIS -= $mins * 60; $diffstr= "$days Days, $hours Hours, $mins Minutes, $secs Seconds"; return $diffstr; } >>

« previous php.general (#55733) next »