def date_validator(optdict, name, value): """validate and return a mx DateTime object for option of type 'date'""" return optparse.check_date(None, name, value)