note 109784 added to dateinterval.format
| From: | Eliddon | Date: | Mon, 20 Aug 2012 22:29:42 +0000 |
| Subject: | note 109784 added to dateinterval.format | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-190145@lists.php.net to get a copy of this message | ||
Just wanted to comment on kuzb's extended class. While it is great the seconds doesn't
calculate correct because he forgot the minutes. Change the to_seconds() function to below:
public function to_seconds()
{
return ($this->y * 365 * 24 * 60 * 60) +
($this->m * 30 * 24 * 60 * 60) +
($this->d * 24 * 60 * 60) +
($this->h * 60 *60) +
($this->i * 60) +
$this->s;
}
----
Server IP: 69.147.83.197
Probable Submitter: 24.150.210.129
----
Manual Page -- http://www.php.net/manual/en/dateinterval.format.php
Edit -- https://master.php.net/note/edit/109784
Del: integrated -- https://master.php.net/note/delete/109784/integrated
Del: useless -- https://master.php.net/note/delete/109784/useless
Del: bad code -- https://master.php.net/note/delete/109784/bad+code
Del: spam -- https://master.php.net/note/delete/109784/spam
Del: non-english -- https://master.php.net/note/delete/109784/non-english
Del: in docs -- https://master.php.net/note/delete/109784/in+docs
Del: other reasons-- https://master.php.net/note/delete/109784
Reject -- https://master.php.net/note/reject/109784
Search -- https://master.php.net/manage/user-notes.php