|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79400 PHP does not parse postgres ISO or RFC date times
Submitted: 2020-03-20 20:53 UTC Modified: 2020-03-29 04:22 UTC
From: ce dot ceo at cybercoment dot com Assigned:
Status: No Feedback Package: Date/time related
PHP Version: 7.4.4 OS: alpine
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ce dot ceo at cybercoment dot com
New email:
PHP Version: OS:


 [2020-03-20 20:53 UTC] ce dot ceo at cybercoment dot com
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")


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-03-20 22:12 UTC]
-Status: Open +Status: Feedback
 [2020-03-20 22:12 UTC]
Is there any particular reason you have to use createFromFormat for this? True, there is no constant that covers their ISO style,
nor a plain "Y-m-d H:i:s", but as you've seen with strtotime() regular parsing works just fine.
 [2020-03-29 04:22 UTC] php-bugs at lists dot php dot net
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.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jan 29 03:03:35 2022 UTC