Yii: how to format datetime in view and search by year

advertisements

I have this code:

array(
        'name'=>'create_time',
        'type'=>'datetime',
        'filter'=>Lookup::items('create_time'),
    ),

I want:

  1. Date to be 01.03.2009 16:09:47, not 2009/01/03 04:09:47 AM (and full month name - with specific language)
  2. Filters with only year

A more Yii orientated way would be:

'value'=>'Yii::app()->dateFormatter->format("d.m.y h:i:s",strtotime($data->datetime))',