|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77600 DateTime ignores timezone of the php.ini
Submitted: 2019-02-11 07:19 UTC Modified: 2019-02-11 12:42 UTC
From: dominik dot zogg at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: Date/time related
PHP Version: 7.3.2 OS: Ubuntu 14.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dominik dot zogg at gmail dot com
New email:
PHP Version: OS:


 [2019-02-11 07:19 UTC] dominik dot zogg at gmail dot com
Create a new DateTime instance with a date, for example 2018-12-01 it get created with GMT, even if the php.ini uses Europe/Zurich

Default timezone => Europe/Zurich
date.timezone => Europe/Zurich => Europe/Zurich

Test script:

$dateTime = new DateTime('2018-12-01');
echo $dateTime->format(\DateTime::ISO8601);
// expected: 2018-12-01T00:00:00+0100 with php.ini (Europe/Zurich)
// what happens: 2018-12-01T00:00:00+0000


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-11 07:33 UTC]
-Status: Open +Status: Feedback
 [2019-02-11 07:33 UTC]
Make sure you're using the latest version, which is currently
 [2019-02-11 08:40 UTC] dominik dot zogg at gmail dot com it works, seems that i had or (installed on friday afternoon)

issue can be closed
 [2019-02-11 12:42 UTC]
-Status: Feedback +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2019-02-11 12:42 UTC]
So, not a bug on our side.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Apr 10 19:01:23 2021 UTC