in elastic_enterprise_search/_utils.py [0:0]
def parse_datetime(value):
# type: (str) -> datetime
"""Convert a string value RFC 3339 into a datetime with tzinfo"""
if not re.match(
r"^[0-9]{4}-[0-9]{2}-[0-9]{2}[T ][0-9]{2}:[0-9]{2}:[0-9]{2}(?:Z|[+\-][0-9]{2}:[0-9]{2})$",
value,
):
raise ValueError(
"Datetime must match format '(YYYY)-(MM)-(DD)T(HH):(MM):(SS)(TZ)' was '%s'"
% value
)
return parser.isoparse(value)