Re: date_diff broken?
| From: | Derick Rethans | Date: | Sat, 18 Jun 2011 09:41:20 +0000 |
| Subject: | Re: date_diff broken? | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53369@lists.php.net to get a copy of this message | ||
On Fri, 17 Jun 2011, Stas Malyshev wrote:
> Hi!
>
> > Does it mean that all the tests Daniel added should work now?
> > http://news.php.net/php.cvs/65174
>
> Looks like ts->date conversion is broken on TLA timezones. Try:
>
> <?php
> $t = new DateTime('2010-11-06 18:38:28 EDT'); // prev, zt2
> $ts = $t->format('U');
> var_dump($ts);
> $t->setTimestamp($ts);
> var_dump($t);
>
> That produces:
>
> object(DateTime)#1 (3) {
> ["date"]=>
> string(19) "2010-11-06 17:38:28"
> ["timezone_type"]=>
> int(2)
> ["timezone"]=>
> string(3) "EDT"
> }
>
> Which obviously is not what it should be. Looks like timelib_unixtime2gmt() or
> timelib_update_from_sse() has some bug that breaks it...
Yes, I know. It's probably because of the "dst" flag. I did see that
yesterday, but didn't have the time to fix it yet, or look at it.
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug