note 94172 added to datetime.getoffset
| From: | ben at sixg dot com | Date: | Tue, 20 Oct 2009 18:44:40 +0000 |
| Subject: | note 94172 added to datetime.getoffset | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-161919@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 69.147.83.197
Probable Submitter: 67.126.53.106
----
Manual Page -- http://www.php.net/manual/en/datetime.getoffset.php
Edit -- https://master.php.net/note/edit/94172
Del: integrated -- https://master.php.net/note/delete/94172/integrated
Del: useless -- https://master.php.net/note/delete/94172/useless
Del: bad code -- https://master.php.net/note/delete/94172/bad+code
Del: spam -- https://master.php.net/note/delete/94172/spam
Del: non-english -- https://master.php.net/note/delete/94172/non-english
Del: in docs -- https://master.php.net/note/delete/94172/in+docs
Del: other reasons-- https://master.php.net/note/delete/94172
Reject -- https://master.php.net/note/reject/94172
Search -- https://master.php.net/manage/user-notes.php