from datetime import datetime


def yyyymmdd_to_date(i):
    """Take a date in the form of an int with format yyyymmdd, and return a datetime"""
    y = i//10000
    m = (i-y*10000)//100
    d = i-y*10000-m*100
    return datetime(y,m,d)