from datetime import datetime
import time


def timestamp_to_datetime(timestamp):
    """
    Converts 13 digit timestamp to datetime object
    :param timestamp: int
    :return: datetime
    """
    return datetime.fromtimestamp(time.mktime(time.gmtime(timestamp / 1000.)))