note 23315 deleted from ref.datetime by vincent
| From: | vincent@php.net | Date: | Thu, 11 Sep 2003 11:55:12 +0000 |
| Subject: | note 23315 deleted from ref.datetime by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56082@lists.php.net to get a copy of this message | ||
Note Submitter: emerix at rol dot ro
----
The simplest function for formating a timestamp difference.
function date_diff ( $date1, $date2 ) {
$some=date("z \\d\\a\\y\\s H\\h i\\m s\\s",$data-7200);
return $some;
}
Where $date1 and $date2 are the timestamps you want.
Ex. date_diff(1024681353, 1023917859);
Will output :
8 days 20h 04m 54s
If you want smater output you should have a
switch(date("z", $date)) {
...
}
in order to avoid "1 days" ...