from datetime import datetime


def get_date(dt):
    """Return datetime from string."""

    return datetime.strptime(dt[:-1] if dt.endswith('Z') else dt,
                             "%Y-%m-%dT%H:%M:%S.%f")