Pandas version checks
-
[x] I have checked that this issue has not already been reported.
-
[x] I have confirmed this bug exists on the latest version of pandas.
-
[ ] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import pandas as pd
print(pd.tseries.api.guess_datetime_format('2025-06-15T21:25:00.000000Z'))
print(pd.tseries.api.guess_datetime_format('2025-06-15T20:24:00.000000Z'))
print(pd.tseries.api.guess_datetime_format('2025-06-15T20:25:00.000000Z'))
# %Y-%m-%dT%H:%M:%S.%f%z
# %Y-%m-%dT%H:%M:%S.%f%z
# None
Issue Description
I'm receiving a strange None
from guess_datetime_format
for a very particular string combination. I can change the hours and minutes separately and it works fine, but when I set the time to exactly 20:25
it produces a None result.
Expected Behavior
It should produce the same '%Y-%m-%dT%H:%M:%S.%f%z'
format as the other two examples.
Installed Versions
Comment From: chilin0525
- Confirmed on
2.3.0
:
```python
import pandas as pd print(pd.tseries.api.guess_datetime_format('2025-06-15T21:25:00.000000Z')) %Y-%m-%dT%H:%M:%S.%f%z print(pd.tseries.api.guess_datetime_format('2025-06-15T20:24:00.000000Z')) %Y-%m-%dT%H:%M:%S.%f%z print(pd.tseries.api.guess_datetime_format('2025-06-15T20:25:00.000000Z')) None
* Works on the main branch, further investigation is required:
python import pandas as pd print(pd.tseries.api.guess_datetime_format('2025-06-15T21:25:00.000000Z')) %Y-%m-%dT%H:%M:%S.%f%z print(pd.tseries.api.guess_datetime_format('2025-06-15T20:24:00.000000Z')) %Y-%m-%dT%H:%M:%S.%f%z print(pd.tseries.api.guess_datetime_format('2025-06-15T20:25:00.000000Z')) %Y-%m-%dT%H:%M:%S.%f%z ```
Comment From: chilin0525
Look like the issue resolved in https://github.com/pandas-dev/pandas/pull/57471, this issue should be able to be closed.
Comment From: asishm
Thanks for the investigation @chilin0525. Closing.
Comment From: logan-dunbar
That pull request was completed over a year ago, will it make it into the next versioned release?
Comment From: asishm
It is currently slated for release with pandas 3.0 unsure if this will get backported to 2.3.x
cc @mroeschke