note 101759 deleted from function.time by danbrown
| From: | danbrown@php.net | Date: | Mon, 10 Jan 2011 17:06:51 +0000 |
| Subject: | note 101759 deleted from function.time by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175600@lists.php.net to get a copy of this message | ||
Note Submitter: steved at vis dot id dot au
----
@nickr
That is a nice script.
Here is a suggested tweak
case "h":
$datediff = floor($difference / 60 / 60);
$minutes = floor(floor($difference / 60) % 60) ;
$res = ($datediff==1) ? "$datediff hour $minutes minutes ago" : "$datediff
hours $minutes minutes ago";
break;
Which changes a rounded "n hours ago" to a more specific "n hours x minutes ago"