Bug #77733 [Com]: IntlDateFormatter parsing incorrectly

From: Date: Fri, 16 Jul 2021 14:22:56 +0000
Subject: Bug #77733 [Com]: IntlDateFormatter parsing incorrectly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235086@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77733&edit=1 ID: 77733 Comment by: akr at cube-interactive dot com Reported by: shariefjamiel at gmail dot com Summary: IntlDateFormatter parsing incorrectly Status: Open Type: Bug Package: I18N and L10N related Operating System: ubuntu 18.04 - php 7.2.15 PHP Version: 7.2.16 Block user comment: N Private report: N New Comment: Encountered with a similar issue In my case, 'en_US' locale the function returns false. https://cube-interactive.com/affordable-seo-packages/ Previous Comments: ------------------------------------------------------------------------ [2021-07-16 12:48:04] anand dot logics at gmail dot com Thank you for sharing the information and saving my time on fixing the bug on WordPress plugin on my website <a href="https://printerrepairhub.ae/hp-printer-repair-services-dubai/">hp printer service center dubai</a> ------------------------------------------------------------------------ [2020-04-06 17:38:06] uaetech0 at gmail dot com Most of the new bloggers starts thinking they will do well in future, But only few succeeds, like you. ‘thank you for sharing information and apply your technique in website looking <a href=" https://printerrepairdubai.ae"> printer repair dubai </a> ------------------------------------------------------------------------ [2019-05-22 10:45:26] andorsarig at yahoo dot com Experienced a similar problem. For example: - with 'en_US' locale the function returns false. - with 'de_DE' returns a timestamp which points with 8 years and a few months later. ------------------------------------------------------------------------ [2019-03-13 09:00:04] shariefjamiel at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=77733&edit=1

« previous php.bugs (#235086) next »