I am making this query in codeigniter4 and I am stuck

```
public function consultasHoy(){

        $data = $this->consultas->select('pacientes.*,consultas_hc.*')
            ->from('consultas_hc')
            ->join('pacientes','consultas_hc.identificacion = pacientes.identificacion')
            ->where(date_format('consultas_rc.reConsulta','%Y-%m-%d'),date_format(now(),'%Y-%m-%d'))
            ->orderBy('consultas_hc.reConsulta', 'ASC')
            ->get();

        return json_encode($data);
    }

```

and it returns this error

> 
> date\_format() expects parameter 1 to be DateTimeInterface, string
> given
> 
> 
>