User Friendly Date Form Timestamp

I have a weird problem that, i have a model and a attribute is create_time (timestamp). I have to show the timestamp as a userfriendly date (Y-M-D) format in view, but the problem is when i search for the date say using date only, or year only, i am getting php warning instead its working when whole string is inputted.

I have done following so far:




//Controller Action:

$dataProvider = new MyModel('search');

		$dataProvider -> unsetAttributes();// clear any default values

		

		if (isset($_GET['MyModel'])) {

			$dataProvider -> attributes = $_GET['MyModel'];

		}

		$this -> render('MyView', array('dataProvider' => $dataProvider, ));




//My View page


$this->widget('zii.widgets.grid.CGridView', array(

'id' =>'list-grid',

    'dataProvider'=>$dataProvider->search(),

    'filter' =>$dataProvider, 

    'columns'=>array(

    	array(

        'first_name',          

        'last_name',

        'consult_price',

        'create_time'=>array('name'=>'create_time',

        					'header' =>'Profile Created In',

        					'value'=>'Components::userFriendlyDate($data->id);',

        					'htmlOptions' =>array('style'=>'text-align: center'),

                                                ..................


// My Model

$criteria = new CDbCriteria;

		if (!empty($this -> create_time)) {

                       // as i say this explodes a string with y-m-d format so i am getting an error.

			list($day, $month, $year) = explode("/", $this -> create_time);

			$daystart = mktime(0, 0, 0, (int)$month, (int)$day, (int)$year);

			$dayend = mktime(23, 59, 59, (int)$month, (int)$day, (int)$year);

			$criteria -> condition = ':s<=create_time AND create_time<=:e';

			$criteria -> params = array(':s' => $daystart, ':e' => $dayend);

		}

$criteria -> compare('create_time', $this -> convert($this -> create_time));

return new CActiveDataProvider($this, array('criteria' => $criteria, ));


//where convert function goes likes this:

  public function convert($date) {

    

    	if ($date == NULL)

    		return $date;

    	//null shows all records

    	else {

    		list($day, $month, $year) = explode("/", $this -> create_time);

    		$daystart = mktime(0, 0, 0, (int)$month, (int)$day, (int)$year);

    		$dayend = mktime(23, 59, 59, (int)$month, (int)$day, (int)$year);

    		$sql = "SELECT create_time FROM MYTable WHERE create_time BETWEEN '$dayend' AND '$daystart'";

    		$result = Yii::app() -> db -> createCommand($sql) -> queryAll();

    		return $result;

    	}

    }



Is there a way to show timestamp in view with user friendly format and that can be searched and sorted with userfriendly format? Please help ! [2 weeks ago! No reply !!]