note 87804 deleted from function.time by danbrown
| From: | danbrown@php.net | Date: | Mon, 22 Dec 2008 21:32:04 +0000 |
| Subject: | note 87804 deleted from function.time by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148465@lists.php.net to get a copy of this message | ||
Note Submitter: Waylon
----
The previous readable_time function is great, except it doesn't work with times that happened
immediately (i.e. the $timestamp == $now).
Here's my fix:
$secs = $now - $timestamp;
//Fix so that something is always displayed
if ($secs == 0) {
$secs = 1;
}
...