php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77582 strftime no longer prints correct timezone
Submitted: 2019-02-07 22:33 UTC Modified: 2019-02-08 20:22 UTC
Votes:5
Avg. Score:4.6 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:5 (100.0%)
Same OS:2 (40.0%)
From: jflambert at newtrax dot com Assigned: ondrej (profile)
Status: Closed Package: Date/time related
PHP Version: 7.3.2 OS: Ubuntu 18.04
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jflambert at newtrax dot com
New email:
PHP Version: OS:

 

 [2019-02-07 22:33 UTC] jflambert at newtrax dot com
Description:
------------
The following test script used to work just fine in PHP 7.3.1. Only after the upgrade to php 7.3.2 did I start getting this issue.

Possibly other date functions are affected. But my unit tests stop immediately on failure. Also I haven't changed anything to my environment in months/years. It very much seems to me like a new 7.3.2 issue, and I couldn't see anything in the 7.3.2 log about backwards incompatible changes.

php --version
PHP 7.3.2-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb  7 2019 18:01:56) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.2, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.2-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.7.0rc1, Copyright (c) 2002-2019, by Derick Rethans


Test script:
---------------
php -a
Interactive mode enabled

php > var_dump(ini_get('date.timezone'));
php shell code:1:
string(16) "America/New_York"
php > echo strftime('%F %T %z');
2019-02-07 22:24:27 +0000
php > echo strftime('%Z');
GMT

Expected result:
----------------
php > echo strftime('%F<br />%T %Z');
2019-02-07<br />17:04:54 EST


Actual result:
--------------
Always seems to be GMT

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-07 23:02 UTC] cmb@php.net
Works like expected on <https://3v4l.org/TdMW6>.
 [2019-02-08 01:22 UTC] jflambert at newtrax dot com
Which part of php -i would be relevant?

Is it possibly related to my PHP ppa (ondrej)?

Some more details:

php > echo ini_get('date.timezone');
America/New_York
php > echo date_default_timezone_get();
America/New_York
php > echo strftime('%F %T %z %Z');
2019-02-08 01:19:00 +0000 GMT

php > echo phpinfo();
....
date

date/time support => enabled
timelib version => 2018.01RC3
"Olson" Timezone Database Version => 0.system
Timezone Database => internal
Default timezone => America/New_York

Directive => Local Value => Master Value
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.583333 => 90.583333
date.sunset_zenith => 90.583333 => 90.583333
date.timezone => America/New_York => America/New_York
 [2019-02-08 01:51 UTC] jflambert at newtrax dot com
I reverted to 7.3.1, no problem. Upgrade to 7.3.2, problem starts again.

Pastebin otherwise flagged as SPAM

https://pastebin.com/2bNcXGHa
 [2019-02-08 02:01 UTC] matt at hatchet dot com dot au
We're seeing the same issue on 7.3.2 and in process of downgrading to 7.3.1
Ubuntu 18.04.1
 [2019-02-08 03:27 UTC] jflambert at newtrax dot com
Matt, thanks for confirming! Where does your PHP come form? Ondrej PPA? Or built from source?
 [2019-02-08 04:26 UTC] matt at hatchet dot com dot au
Ondrej PPA too. We ended up popping in Ubuntu disco repo temporarily, downgrading, holding the packages, then removing the disco src. Now having issues with intl but that's probably due to a package it relies on being upgraded. I was able to reproduce the issue on two separate Ubuntu 18.04 boxes using Ondrej PPA
 [2019-02-08 04:31 UTC] requinix@php.net
-Assigned To: +Assigned To: ondrej
 [2019-02-08 04:31 UTC] requinix@php.net
Also working for me. I'm inclined to think the problem is on the PPA side...
 [2019-02-08 05:42 UTC] matt at hatchet dot com dot au
I've just built from git src and cannot reproduce the issue anymore on 7.3.2 so it appears it may very well be the PPA.
 [2019-02-08 10:40 UTC] solusvm at web dot de
I'm experiencing the same issue since I upgraded to PHP 7.3.2 a few hours ago. I reproduced this on multiple servers and I'm using Debian 9 with the Sury PPA (https://packages.sury.org/php/)...

I hope that there will be a fix for this issue soon.
 [2019-02-08 11:17 UTC] alec@php.net
Similar issue here with PHP 7.3.2-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Feb  7 2019 18:01:56) ( NTS )

strtotime('2013/06/21 12:00:00 Europe/Berlin') returns the same value no matter what timezone name I use.
 [2019-02-08 20:22 UTC] jflambert at newtrax dot com
-Status: Assigned +Status: Closed
 [2019-02-08 20:22 UTC] jflambert at newtrax dot com
It was a problem in the PPA after all. Ondrej just fixed it. Everyone should be able to update to the latest deb packages (7.3.2-3+ubuntu18.04.1+deb.sury.org+1)

Next time I'll make sure to run tests via 3v4l.org first!
 [2019-02-08 20:30 UTC] ondrej@php.net
Kudos to Remi as I used his fixed version of systzdata patch to fix the issue after I botched to update the patch myself.
 [2019-03-04 07:28 UTC] ds at marco dot de
Hello,

what was the problem? We have the similar issue under opensuse.

Regards
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC