(msg=None)
return fn
Checks whether a value is :
        - a valid castable datetime object with timezone.
Checks whether a value is :
        - a valid castable datetime object with timezone.
Checks whether a value is : - a valid castable datetime object with timezone .
def DatetimeWithTZ(msg=None):
    '''
    Checks whether a value is :
        - a valid castable datetime object with timezone.
    '''
    def fn(value):
        try:
            date = parse_datetime(value) or parse_date(value)
            if date is not None:
                return date
            else:
                raise ValueError
        except ValueError:
            raise Invalid('<{0}> is not a valid datetime.'.format(value))
    return fn
def DatetimeWithTZ ( msg = None ) : def fn ( value ) : try : date = parse_datetime ( value ) or parse_date ( value ) if date is not None : return date else : raise ValueError except ValueError : raise Invalid ( '<{0}> is not a valid datetime.' . format ( value ) ) return fn