Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Hour incremented before declared #3

Open
spence opened this issue Sep 6, 2014 · 0 comments
Open

Hour incremented before declared #3

spence opened this issue Sep 6, 2014 · 0 comments

Comments

@spence
Copy link

spence commented Sep 6, 2014

>>> import datetime
>>> import dateutil
>>> dt_str = datetime.datetime(2014, 1, 1, 13).strftime('%p %-I:%M')  # 'PM 1:00'
>>> dateutil.parser.parse(dt_str)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dateutil/parser.py", line 697, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "dateutil/parser.py", line 301, in parse
    res = self._parse(timestr, **kwargs)
  File "dateutil/parser.py", line 557, in _parse
    res.hour += 12
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'int'

I'm aware this is not the official repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant