code: def datetime_normalizer(self, value):
          
  
          if (
              isinstance(value, datetime.date)
              and not isinstance(value, datetime.datetime)
          ):
              # Convert to local midnight
              value_full = datetime.datetime.combine(value, datetime.time.min)
              localized = local_zone.localize(value_full)
          elif isinstance(value, datetime.datetime):
              if value.tzinfo is None:
                  # Convert to localized datetime object
                  localized = local_zone.localize(value)
              else:
                  # If the value is already localized, there is no need to change
                  # time zone at this point. Also None is a valid value too.
                  localized = value
          elif isinstance(value, six.string_types):
              localized = self.backend.convert_datetime_string(value)
          else:
              raise ValueError("Provided value could not be converted to "
                               "datetime, its type is not supported: {}"
                               .format(type(value)))
  
          return localized
docs: Normalizes date/datetime value (considered to come from user input)
          to localized datetime value. Following conversions happen:
  
          naive date -> localized datetime with the same date, and time=midnight
          naive datetime -> localized datetime with the same value
          localized datetime -> localized datetime (no conversion)