from datetime import datetime


def parse_datetime(string, format="%Y-%m-%dT%H:%M:%SZ"):
    """
    Parses a string into a datetime instance.

    If `format` is not provided, expect format is `2031-08-28T17:52:27Z`.
    """
    return datetime.strptime(string, format)