php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #47807 dateTime::setTimezone doc inconsistency
Submitted: 2009-03-27 14:05 UTC Modified: 2009-03-27 16:13 UTC
From: jking at jkingweb dot ca Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Debian
Private report: No CVE-ID: None
 [2009-03-27 14:05 UTC] jking at jkingweb dot ca
Description:
------------
Either the manual is incorrect or there is a bug in PHP 5.2.9: While the manual states that DateTime::setTimezone returns a new (modified) DateTime instance, DateTime::setTimezone actually modifies its DateTime instance and returns NULL.  Examples in the manul page would suggest PHP 5.2.9 is working correctly and the manual is wrong.

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



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-27 16:11 UTC] bjori@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.

As of PHP5.3.0 it returns the DateTime object ("fluent interface").
 [2009-03-27 16:13 UTC] bjori@php.net
Looks like more of the methods are missing similar changelogs.. I'll fix them too.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 18:00:02 2026 UTC