Doc #71689 [NEW]: IntlDateFormatter uses system timezone instead of default
| From: | dcrystal dot source at gmail dot com | Date: | Mon, 29 Feb 2016 13:56:45 +0000 |
| Subject: | Doc #71689 [NEW]: IntlDateFormatter uses system timezone instead of default | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-13225@lists.php.net to get a copy of this message | ||
From: dcrystal dot source at gmail dot com
Operating system: Linux
PHP version: Irrelevant
Package: intl
Bug Type: Documentation Problem
Bug description:IntlDateFormatter uses system timezone instead of default
Description:
------------
As per documentation
(http://php.net/manual/en/intldateformatter.create.php), 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:
---------------
date_default_timezone_set("America/New_York");
$dateFormatter = new IntlDateFormatter('en_US', IntlDateFormatter::NONE,
IntlDateFormatter::NONE);
$dateFormatter->setPattern('MM/dd/yy');
$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"
--
Edit bug report at https://bugs.php.net/bug.php?id=71689&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71689&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71689&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71689&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71689&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71689&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71689&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71689&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71689&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71689&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71689&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71689&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71689&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71689&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71689&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71689&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71689&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71689&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71689&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71689&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71689&r=mysqlcfg