def METHOD_NAME(
    self, targetinputdatefield, newdate, withTime=True
):
    if withTime:
        val = date_format(newdate, "DATETIME_FORMAT", use_l10n=False)
    else:
        val = newdate.strftime("%m-%d-%Y")
    targetinputdatefield.clear()
    time.sleep(0.3)
    targetinputdatefield.send_keys(val)
    time.sleep(0.3)
    targetinputdatefield.send_keys(Keys.RETURN)
    time.sleep(0.3)
    return val