|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #71689 IntlDateFormatter uses system timezone instead of default
Submitted: 2016-02-29 13:56 UTC Modified: -
From: dcrystal dot source at gmail dot com Assigned:
Status: Open Package: intl (PECL)
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
28 - 21 = ?
Subscribe to this entry?

 [2016-02-29 13:56 UTC] dcrystal dot source at gmail dot com
As per documentation (, the default timezone (and the one used if NULL is given) is the one returned by date_default_timezone_get(). 

This is not the case however with IntlDateFormatter and PHP 5.4/5.3 - which seems to use system timezone instead of date_default_timezone_get().

PHP Version: PHP 5.4.16 / PHP 5.3.3
System timezone: GMT

Even though 5.3 and 5.4 are EOL - they are still widely used. Could this be at least explicitly stated in documentation (changelog section probably) ?

Test script:
$dateFormatter = new IntlDateFormatter('en_US', IntlDateFormatter::NONE, IntlDateFormatter::NONE);
$parsed = $dateFormatter->parse("02/29/16");

var_dump(date("Y-m-d H:i:s", $parsed));

Expected result:
"2016-02-29 00:00:00"

Actual result:
"2016-02-28 19:00:00"


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jun 13 12:01:23 2021 UTC