Bug #79400 [Fbk->NoF]: PHP does not parse postgres ISO or RFC date times

From: Date: Sun, 29 Mar 2020 04:22:09 +0000
Subject: Bug #79400 [Fbk->NoF]: PHP does not parse postgres ISO or RFC date times
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226311@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79400&edit=1 ID: 79400 Updated by: php-bugs@lists.php.net Reported by: ce dot ceo at cybercoment dot com Summary: PHP does not parse postgres ISO or RFC date times -Status: Feedback +Status: No Feedback Type: Bug Package: Date/time related Operating System: alpine PHP Version: 7.4.4 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2020-03-20 22:12:24] requinix@php.net Is there any particular reason you have to use createFromFormat for this? True, there is no constant that covers their ISO style, https://www.postgresql.org/docs/9.1/datatype-datetime.html#DATATYPE-DATETIME-OUTPUT nor a plain "Y-m-d H:i:s", but as you've seen with strtotime() regular parsing works just fine. ------------------------------------------------------------------------ [2020-03-20 20:53:49] ce dot ceo at cybercoment dot com Description: ------------ PHP 7.4.1 Postgres 11.6 None of the DateTime format strings successfully parse dates from Postgres's default "ISO" format (Although postgres has its own bugs where they use a space instead of a 'T') strtotime works but it's a timestamp instead of a datetime. Test script: --------------- DateTime::createFromFormat(DateTime::ISO8601, "2021-03-12 20:17:36.922347") DateTime::createFromFormat(DateTime::RFC3339, "2021-03-12 20:17:36.922347") DateTime::createFromFormat(DateTime::RFC3339_EXTENDED, "2021-03-12 20:17:36.922347") ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=79400&edit=1

« previous php.bugs (#226311) next »