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

Hour incremented before declared #3

Description

@spence
>>> 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions