note 87804 added to function.time
| From: | Waylon at osu1 dot php dot net | Date: | Mon, 22 Dec 2008 21:00:43 +0000 |
| Subject: | note 87804 added to function.time | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148461@lists.php.net to get a copy of this message | ||
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;
}
...
----
Server IP: 202.89.58.1
Probable Submitter: 210.48.162.6
----
Manual Page -- http://www.php.net/manual/en/function.time.php
Edit -- https://master.php.net/note/edit/87804
Del: integrated -- https://master.php.net/note/delete/87804/integrated
Del: useless -- https://master.php.net/note/delete/87804/useless
Del: bad code -- https://master.php.net/note/delete/87804/bad+code
Del: spam -- https://master.php.net/note/delete/87804/spam
Del: non-english -- https://master.php.net/note/delete/87804/non-english
Del: in docs -- https://master.php.net/note/delete/87804/in+docs
Del: other reasons-- https://master.php.net/note/delete/87804
Reject -- https://master.php.net/note/reject/87804
Search -- https://master.php.net/manage/user-notes.php