Bug #77600 [Opn->Fbk]: DateTime ignores timezone of the php.ini
| From: | requinix@php.net | Date: | Mon, 11 Feb 2019 07:33:17 +0000 |
| Subject: | Bug #77600 [Opn->Fbk]: DateTime ignores timezone of the php.ini | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219488@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77600&edit=1
ID: 77600
Updated by: requinix@php.net
Reported by: dominik dot zogg at gmail dot com
Summary: DateTime ignores timezone of the php.ini
-Status: Open
+Status: Feedback
Type: Bug
Package: Date/time related
Operating System: Ubuntu 14.04
PHP Version: 7.3.2
Block user comment: N
Private report: N
New Comment:
Make sure you're using the latest version, which is currently
7.3.2-3+ubuntu14.04.1+deb.sury.org+1.
Previous Comments:
------------------------------------------------------------------------
[2019-02-11 07:19:35] dominik dot zogg at gmail dot com
Description:
------------
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:
---------------
<?php
$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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77600&edit=1