def METHOD_NAME(date):
    if date is None:
        return None
    if isinstance(date, str):
        fp = date.find(".")
        if fp > 0:
            date += '0' * (6 - len(date[fp + 1:]))
        date = datetime.fromisoformat(date)
    return int(datetime.timestamp(date) * 1000)