php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #49773 DateTime class getOffset function documentation bug
Submitted: 2009-10-05 05:16 UTC Modified: 2009-11-13 21:29 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: rohit at rhovisions dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.3.0 OS: Windows
Private report: No CVE-ID: None
 [2009-10-05 05:16 UTC] rohit at rhovisions dot com
Description:
------------
At http://www.php.net/manual/en/datetime.getoffset.php it says "DateTime::getOffset ? Returns the daylight saving time offset". This is not accurate, as the function returns the current timezones offset from GMT/UTC (I don't know which one). For EST for example, it shows -14400 seconds for the summer, which is -4 hours, the EST offset from GMT. If I set a winter date, I get -18000 seconds, -5 hours, which is the winter offset as appropriate, from GMT.

Its really misleading to simply say that getOffset returns the daylight savings time offset when that's not what it shows at all. I've been searching for a function to show the DST offset, thought this was the solution, and now find that's not the case.

Reproduce code:
---------------
---
From manual page: datetime.getoffset
---



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-13 21:29 UTC] svn@php.net
Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&revision=290703
Log: Not always DST (bug #49773)
 [2009-11-13 21:29 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Jun 16 09:00:02 2026 UTC