php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72233 IntlDateFormatter uses bad timezone data for Russia
Submitted: 2016-05-17 18:38 UTC Modified: 2016-05-18 11:46 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: mateusz dot m dot nowaczyk at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: intl (PECL)
PHP Version: Irrelevant OS: Debian, RHEL, Ubuntu
Private report: No CVE-ID: None
 [2016-05-17 18:38 UTC] mateusz dot m dot nowaczyk at gmail dot com
Description:
------------
How to reproduce: create a DateTime object $dateTime with value of year 2015 (haven't tested other years), set any Russian timezone (e.g. Europe/Moscow), check the result of $dateTime->format('H:i') and compare with result of IntlDateFormatter::format with the same timezone. 
Problem exists in versions 5.6.20+dfsg-0+deb8u1 (debian jessie), 5.4.45 (CentOS) and 7.0.4 (Ubuntu). There was a similar bug (68434), marked as closed with a comment stating that "the data at least should be updated in the next release." Well, it certainly should, since 2014.

Test script:
---------------
$now = new \DateTime();
$russian = new\DateTimeZone('Europe/Moscow');
$now->setTimezone($russian);
$fmt = new IntlDateFormatter(
 'en-US',
 IntlDateFormatter::FULL,
 IntlDateFormatter::FULL,
 'Europe/Moscow',
 IntlDateFormatter::GREGORIAN
 );
echo $now->format('Y-m-d H:i:s');
echo $fmt->format($now);

Expected result:
----------------
2016-05-17 21:26:38
Tuesday, May 17, 2016 at 09:26:38 PM Moscow Standard Time


Actual result:
--------------
2016-05-17 21:26:38
Tuesday, May 17, 2016 at 10:26:38 PM Moscow Standard Time

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-05-18 11:46 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2016-05-18 11:46 UTC] cmb@php.net
This is not a bug in PHP (see <https://3v4l.org/YOtDd>), but
rather a configuration/system issue. On Linux systems the PHP intl
extension is build against the ICU library of the system, and
obviously, your system has a somewhat old version. You can check
which ICU version and ICU Data version you're running with:

  php -i | grep ICU
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC