              return "DATE(%s)" % (field_name)
  
      def _convert_field_to_tz(self, field_name, tzname):
          if settings.USE_TZ:
              field_name = "CONVERT_TZ(%s, 'UTC', %%s)" % field_name
              params = [tzname]
          else:
              params = []
          return field_name, params
  
      def datetime_cast_date_sql(self, field_name, tzname):
          field_name, params = self._convert_field_to_tz(field_name, tzname)
          sql = "DATE(%s)" % field_name
          return sql, params
 
</s> remove         field_name, params = self._convert_field_to_tz(field_name, tzname)
        sql = "DATE(%s)" % field_name
        return sql, params
 </s> add         field_name = self._convert_field_to_tz(field_name, tzname)
        return "DATE(%s)" % 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 </s> remove         field_name, params = self._convert_field_to_tz(field_name, tzname)
        sql = "TIME(%s)" % field_name
        return sql, params
 </s> add         field_name = self._convert_field_to_tz(field_name, tzname)
        return "TIME(%s)" % field_name </s> remove         field_name, params = self._convert_field_to_tz(field_name, tzname)
        sql = '(%s)::date' % field_name
        return sql, params
 </s> add         field_name = self._convert_field_to_tz(field_name, tzname)
        return '(%s)::date' % field_name </s> remove         field_name, params = self._convert_field_to_tz(field_name, tzname)
        sql = '(%s)::time' % field_name
        return sql, params
 </s> add         field_name = self._convert_field_to_tz(field_name, tzname)
        return '(%s)::time' % field_name
            field_name = "CONVERT_TZ(%s, 'UTC', '%s')" % (field_name, tzname)
        return field_name
              return "DATE(%s)" % (field_name)
  
      def _convert_field_to_tz(self, field_name, tzname):
          if settings.USE_TZ:
            field_name = "CONVERT_TZ(%s, 'UTC', '%s')" % (field_name, tzname)
        return field_name
            field_name = "CONVERT_TZ(%s, 'UTC', '%s')" % (field_name, tzname)
        return field_name
            field_name = "CONVERT_TZ(%s, 'UTC', '%s')" % (field_name, tzname)
        return field_name
            field_name = "CONVERT_TZ(%s, 'UTC', '%s')" % (field_name, tzname)
        return field_name
            field_name = "CONVERT_TZ(%s, 'UTC', '%s')" % (field_name, tzname)
        return field_name
  
      def datetime_cast_date_sql(self, field_name, tzname):
          field_name, params = self._convert_field_to_tz(field_name, tzname)
          sql = "DATE(%s)" % field_name
          return sql, params
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Fixed #27802 -- Unified return value of db backend datetime SQL methods. 
django/db/backends/mysql/operations.py