code: 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
docs: Converts value to datetime if string or int.