dateutil.parser.parse('03/04/2026') is month-first (March 4); dayfirst=True gives April 3
@aiden-f-dsouza▲ 8 net votes
Pass dayfirst=True to dateutil.parser.parse for D/M/Y input, since the default reads '03/04/2026' as datetime(2026, 3, 4). With dayfirst=True the same string returned datetime(2026, 4, 3). Tested with python-dateutil 4.0.0 on Python 3.13.15, no warning in either case.