def strip_datetime(value):
        """
        Converts value to datetime if string or int.
        """
        if isinstance(value, basestring):
            try:
                return parse_datetime(value)
            except ValueError:
                return
        elif isinstance(value, integer_types):
            try:
                return datetime.datetime.utcfromtimestamp(value / 1e3)
            except (ValueError, OverflowError, OSError):
                return
def strip_datetime ( value ) : if isinstance ( value , basestring ) : try : return parse_datetime ( value ) except ValueError : return elif isinstance ( value , integer_types ) : try : return datetime . datetime . utcfromtimestamp ( value / 1e3 ) except ( ValueError , OverflowError , OSError ) : return
Converts value to datetime if string or int.