def datetime_range_exclusive(min, max, format):
dmin = datetime.strptime(min, format)<EOL>dmax = datetime.strptime(max, format)<EOL>def checker(v):<EOL><INDENT>dv = datetime.strptime(v, format)<EOL>if dv <= dmin or dv >= dmax:<EOL><INDENT>raise ValueError(v)<EOL><DEDENT><DEDENT>return checker<EOL>
Return a value check function which raises a ValueError if the supplied
value when converted to a datetime using the supplied `format` string is
less than or equal to `min` or greater than or equal to `max`.