Bug #77733 [Com]: IntlDateFormatter parsing incorrectly

From: Date: Mon, 06 Apr 2020 17:38:06 +0000
Subject: Bug #77733 [Com]: IntlDateFormatter parsing incorrectly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226443@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: uaetech0 at gmail dot com Reported by: shariefjamiel at gmail dot com Summary: IntlDateFormatter parsing incorrectly Status: Open Type: Bug Package: Date/time related Operating System: ubuntu 18.04 - php 7.2.15 PHP Version: 7.2.16 Block user comment: N Private report: N New Comment: 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> Previous Comments: ------------------------------------------------------------------------ [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 (#226443) next »