Feature Type

  • [ ] Adding new functionality to pandas

  • [ ] Changing existing functionality in pandas

  • [ ] Removing existing functionality in pandas

Problem Description

stdlib accepts these as ISO8601

$ python3.11
Python 3.11.1 (main, Dec  7 2022, 01:11:34) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime as dt
>>> dt.datetime.fromisoformat
<built-in method fromisoformat of type object at 0xa31060>
>>> dt.datetime.fromisoformat('20110519 010000')
datetime.datetime(2011, 5, 19, 1, 0)
>>> dt.datetime.fromisoformat('20110519T010000')
datetime.datetime(2011, 5, 19, 1, 0)

but pandas doesn't guess them:

In [5]: assert guess_datetime_format("20110519 010000") is None

Feature Description

This probably needs amending to guess more iso8601 formats:

https://github.com/pandas-dev/pandas/blob/502919e4b18e5d5aca584d4ebb84d663fcefffc9/pandas/_libs/tslibs/parsing.pyx#L843-L859

Expected output:

>>> guess_datetime_format("20110519 010000")
'%Y%m%d %H%M%S'

Alternative Solutions

If https://github.com/dateutil/dateutil/issues/1138 was implemented, then that would probably be the best solution. Though, outside of pandas' control

Additional Context

No response

Comment From: ramvikrams

The dateutil issue was still open so I appended our parsing.pyx and made a pr