from datetime import datetime


def parse_datetime(date_string):
    """Parse a datetime string as returned by the ``matches`` endpoint to a
    datetime object.

    >>> parse_datetime('2014-07-04T18:00:00Z')
    datetime.datetime(2014, 7, 4, 18, 0)

    """
    return datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%SZ")