Doc #77733 [NEW]: IntlDateFormatter parsing incorrectly

From: Date: Wed, 13 Mar 2019 09:00:04 +0000
Subject: Doc #77733 [NEW]: IntlDateFormatter parsing incorrectly
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16481@lists.php.net to get a copy of this message
From: shariefjamiel at gmail dot com Operating system: ubuntu 18.04 - php 7.2.15 PHP version: 7.2.16 Package: Date/time related Bug Type: Documentation Problem Bug description:IntlDateFormatter parsing incorrectly Description: ------------ --- From manual page: https://php.net/intldateformatter.parse --- Passing a totally wrong datetime format returns a valid but strange datetime despite the date formats being so different. e.g. 2019-12-10 10:10:00 becomes 2016-06-10 09:10:00 If the date format is wrong to start with, should it not return null? Test script: --------------- use IntlDateFormatter; $formatter = new IntlDateFormatter('en_GB', 3, 3, 'Europe/London', 0, null); $date = '2019-12-10 10:10:00'; echo date('Y-m-d H:i:s', $formatter->parse($date)); Expected result: ---------------- null Actual result: -------------- 2016-06-10 09:10:00 -- Edit bug report at https://bugs.php.net/bug.php?id=77733&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77733&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77733&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77733&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77733&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77733&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77733&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77733&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77733&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77733&r=support Expected behavior: https://bugs.php.net/fix.php?id=77733&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77733&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77733&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77733&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77733&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77733&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77733&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77733&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77733&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77733&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77733&r=mysqlcfg

« previous php.doc.bugs (#16481) next »