note 94172 rejected from datetime.getoffset by thiago
| From: | thiago@php.net | Date: | Tue, 20 Oct 2009 19:12:31 +0000 |
| Subject: | note 94172 rejected from datetime.getoffset by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161920@lists.php.net to get a copy of this message | ||
Note Submitter: ben at sixg dot com
----
The documentation and example imply that this method is only concerned with daylight saving time,
but as erik's example demonstrates this is not true. It's really just returning the
current UTC offset of the current timezone associated with this DateTime. For the US/Pacific
timezone, it currently returns -25200 (-7 hours), and if I give it a date a few weeks hence (after
Daylight Savings Time ends) it returns -28800 (-8 hours).
The documentation should really be updated to clarify this. And the example is terrible of course,
because London happens to match UTC part of the time. A timezone farther from UTC should be used
instead.