Bug #77600 [Com]: DateTime ignores timezone of the php.ini
| From: | dominik dot zogg at gmail dot com | Date: | Mon, 11 Feb 2019 08:40:38 +0000 |
| Subject: | Bug #77600 [Com]: DateTime ignores timezone of the php.ini | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219491@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
Comment by: dominik dot zogg at gmail dot com
Reported by: dominik dot zogg at gmail dot com
Summary: DateTime ignores timezone of the php.ini
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:
requinix@php.net it works, seems that i had 7.3.2-1+ubuntu14.04.1+deb.sury.org+1 or
7.3.2-2+ubuntu14.04.1+deb.sury.org+1 (installed on friday afternoon)
issue can be closed
Previous Comments:
------------------------------------------------------------------------
[2019-02-11 07:33:17] requinix@php.net
Make sure you're using the latest version, which is currently
7.3.2-3+ubuntu14.04.1+deb.sury.org+1.
------------------------------------------------------------------------
[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