I've got a number of datetimes in a spreadsheet that look like this:
July 29, 2022 @ 9:44 AM
Aug 2, 2022 @ 6:30 PM
...
I'm attempting to parse these with the following:
>>> import arrow
>>> myformat = "MMM D, YYYY @ H:MM A"
>>> arrow.get("Aug 2, 2022 @ 11:37 PM", myformat)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\enricojr\Projects\python-lox\.venv\lib\site-packages\arrow\api.py", line 91, in get
return _factory.get(*args, **kwargs)
File "C:\Users\enricojr\Projects\python-lox\.venv\lib\site-packages\arrow\factory.py", line 295, in get
dt = parser.DateTimeParser(locale).parse(
File "C:\Users\enricojr\Projects\python-lox\.venv\lib\site-packages\arrow\parser.py", line 346, in parse
return self._build_datetime(parts)
File "C:\Users\enricojr\Projects\python-lox\.venv\lib\site-packages\arrow\parser.py", line 701, in _build_datetime
datetime(
ValueError: month must be in 1..12
>>> arrow.__version__
'1.2.2'
>>>
Documentation states that "MMM" is the token for abbreviated months, but it's expecting a number from 1 - 12 instead. Am I using the tokens incorrectly?
I've got a number of datetimes in a spreadsheet that look like this:
I'm attempting to parse these with the following:
Documentation states that "MMM" is the token for abbreviated months, but it's expecting a number from 1 - 12 instead. Am I using the tokens incorrectly?
Python version: 3.10.4 Arrow version: 1.2.2