      def datetime_cast_date_sql(self, field_name, tzname):
          return "django_datetime_cast_date(%s, %%s)" % field_name, [tzname]
  
      def datetime_cast_time_sql(self, field_name, tzname):
          return "django_datetime_cast_time(%s, %%s)" % field_name, [tzname]
  
      def datetime_extract_sql(self, lookup_type, field_name, tzname):
          # Same comment as in date_extract_sql.
          return "django_datetime_extract('%s', %s, %%s)" % (
              lookup_type.lower(), field_name), [tzname]
 
</s> remove         return "django_datetime_extract('%s', %s, %%s)" % (
            lookup_type.lower(), field_name), [tzname]
 </s> add         return "django_datetime_extract('%s', %s, %s)" % (
            lookup_type.lower(), field_name, self._convert_tzname_to_sql(tzname),
        ) </s> remove         return "django_datetime_cast_date(%s, %%s)" % field_name, [tzname]
 </s> add         return "django_datetime_cast_date(%s, %s)" % (
            field_name, self._convert_tzname_to_sql(tzname),
        ) </s> remove         return "django_datetime_trunc('%s', %s, %%s)" % (
            lookup_type.lower(), field_name), [tzname]
 </s> add         return "django_datetime_trunc('%s', %s, %s)" % (
            lookup_type.lower(), field_name, self._convert_tzname_to_sql(tzname),
        ) </s> remove             field_name = "CONVERT_TZ(%s, 'UTC', %%s)" % field_name
            params = [tzname]
        else:
            params = []
        return field_name, params
 </s> add             field_name = "CONVERT_TZ(%s, 'UTC', '%s')" % (field_name, tzname)
        return field_name </s> remove             field_name = "%s AT TIME ZONE %%s" % field_name
            params = [tzname]
        else:
            params = []
        return field_name, params
 </s> add             field_name = "%s AT TIME ZONE '%s'" % (field_name, tzname)
        return field_name
        return "django_datetime_cast_time(%s, %s)" % (
            field_name, self._convert_tzname_to_sql(tzname),
        )
      def datetime_cast_date_sql(self, field_name, tzname):
          return "django_datetime_cast_date(%s, %%s)" % field_name, [tzname]
  
      def datetime_cast_time_sql(self, field_name, tzname):
        return "django_datetime_cast_time(%s, %s)" % (
            field_name, self._convert_tzname_to_sql(tzname),
        )
  
      def datetime_extract_sql(self, lookup_type, field_name, tzname):
          # Same comment as in date_extract_sql.
          return "django_datetime_extract('%s', %s, %%s)" % (
              lookup_type.lower(), field_name), [tzname]
keep keep keep keep replace keep keep keep keep keep
 Fixed #27802 -- Unified return value of db backend datetime SQL methods. 
django/db/backends/sqlite3/operations.py