note 109784 deleted from dateinterval.format by danbrown
| From: | danbrown@php.net | Date: | Fri, 31 Aug 2012 15:49:31 +0000 |
| Subject: | note 109784 deleted from dateinterval.format by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190340@lists.php.net to get a copy of this message | ||
Note Submitter: Eliddon
----
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;
}