from datetime import datetime


def is_datenum(datenum):
    """ Return True if given str is a date in format %Y%m%d """
    try:
        datetime.strptime(datenum, "%Y%m%d")
        return True
    except (ValueError, TypeError):
        return False