You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title is unclear, since I don't know WHAT causes the issue. But "dayfirst=True" implies logically that month comes last in the string. But check this:
>>>parse("2020-1-10", dayfirst=True)
datetime.datetime(2020, 10, 1, 0, 0) #correct>>>parse("2020-1-10", dayfirst=False)
datetime.datetime(2020, 1, 10, 0, 0) #correct>>>parse("2020-09-30", dayfirst=True)
datetime.datetime(2020, 9, 30, 0, 0) #false, should give an error because month can't be bigger than 12>>>parse("2020-09-30", dayfirst=False)
datetime.datetime(2020, 9, 30, 0, 0) #correctparse("2020-30-09", dayfirst=True)
datetime.datetime(2020, 9, 30, 0, 0) #correct >>>parse("2020-30-09", dayfirst=False)
dateutil.parser._parser.ParserError: monthmustbein1..12: 2020-30-09#That's the expected output
So, it looks like "something is wrong" when dayfirst=True.
It could have been the range check that results in a parserError month must be in 1..12: does not happen, but:
>>>parse("2020-09-31", dayfirst=True)
dateutil.parser._parser.ParserError: dayisoutofrangeformonth: 2020-09-31#huh? what about dayfirst???
The text was updated successfully, but these errors were encountered:
::param dayfirst
Whether to interpret the first value in an ambiguous 3-integer date (e.g. 01/05/09) as the day (True) or month (False).
If yearfirst is set to True, this distinguishes between YDM and YMD.
So seems like this parameter is not considered when providing a 4 character year, as in your examples.
Title is unclear, since I don't know WHAT causes the issue. But "dayfirst=True" implies logically that month comes last in the string. But check this:
So, it looks like "something is wrong" when dayfirst=True.
It could have been the range check that results in a parserError month must be in 1..12: does not happen, but:
The text was updated successfully, but these errors were encountered: