32
32
from datetime import datetime, timedelta, tzinfo
35
36
__all__ = ["parse_date", "ParseError"]
37
38
# Adapted from http://delete.me.uk/2005/03/iso8601.html
39
40
r"((?P<separator>.)(?P<hour>[0-9]{2}):(?P<minute>[0-9]{2})(:(?P<second>[0-9]{2})(\.(?P<fraction>[0-9]+))?)?"
40
41
r"(?P<timezone>Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?"
44
54
class ParseError(Exception):
45
55
"""Raised when there is a problem parsing a date string"""