Bug #76576 [Opn->Fbk]: DateTime formats different Timezones with 'e' and 'T' format codes
| From: | requinix@php.net | Date: | Wed, 04 Jul 2018 08:51:06 +0000 |
| Subject: | Bug #76576 [Opn->Fbk]: DateTime formats different Timezones with 'e' and 'T' format codes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216128@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76576&edit=1
ID: 76576
Updated by: requinix@php.net
Reported by: nospam at tils dot org
Summary: DateTime formats different Timezones with 'e' and
'T' format codes
-Status: Open
+Status: Feedback
Type: Bug
Package: Date/time related
Operating System: Ubuntu
PHP Version: 7.2.7
Block user comment: N
Private report: N
New Comment:
I can't figure out how to reproduce this. Are you running that exact script? Unchanged? Are you
doing anything else with timezones? Do you have the date.timezone setting something other than UTC?
Previous Comments:
------------------------------------------------------------------------
[2018-07-04 08:13:16] nospam at tils dot org
Description:
------------
If you set a timezone on a DateTime object and you output "e" and "T" values,
different Timezones will be returned. I have a german system here and PHP 7.2 seems to always output
the system timezone in "T", but output the manually assigned timezone in "e".
In PHP 5.6 the output of the test script is: "12:15:03 UTC UTC"
In PHP 7.2.7 the output is: "12:15:03 UTC CEST"
Test script:
---------------
<?php
$date = new Datetime('2018-05-01 12:15:03');
$date->setTimeZone(new DateTimeZone('UTC'));
echo $date->format('H:i:s e T');
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76576&edit=1