Suggested here: https://github.com/pandas-dev/pandas/pull/50242#discussion_r1057825783

Here are the relevant lines of code:

https://github.com/pandas-dev/pandas/blob/4e88c3f0389a1a7ecff8bfd23615c84ed92db951/pandas/_libs/tslibs/parsing.pyx#L821-L838

Comment From: ShashwatAgrawal20

take