from datetime import datetime


def getDatetime(t):
    """
    get the date and time from a raw image filename
    and create a datetime variable
    """
    ychk = int(t[8:12])
    mthchk = int(t[12:14])
    dchk = int(t[14:16])
    hchk = int(t[16:18])
    minchk = int(t[18:20])
    schk = int(t[20:22])
    x = datetime(year=ychk, month=mthchk,
                 day=dchk, hour=hchk,
                 minute=minchk, second=schk)
    return x