Problem Comparing With Date Format

Hi veryone , I show the dates on my gridviews like d-m-y and when I’m gonna use the search, it doesn’t work obviously because when yii compare one date is formated like Y-m-d(model) and in the gridView is like d-m-Y so I tried to fix it changing on the model the compare instruction in function search like :

//instead of this:

$criteria->compare(‘date1’,$this->date1,true);

//I used this.

$criteria->compare(‘date(“d-m-Y”,strtotime(date1))’,$this->date1,true);

But this doen’t work, can anyone help me??

Thanks!