from datetime import datetime


def to_datetime(timestamp):
    """
    Convert MediaWiki timestamp to a datetime object.
    Assumes the format to be in "MW" ISO with "Z" instead of +00:00 for timezone.
    :type timestamp: str
    :rtype datetime
    """
    return datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%SZ')