CGridView date() Problem

I try to formate my Timestamp:


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

    'dataProvider'=>$dataProvider,

    'columns'=>array(

		array(          

            'class'=>'CLinkColumn',

			'header'=>'Titel',

			'labelExpression'=>'$data->titel',

			'urlExpression'=>'Yii::app()->controller->createUrl("update",array("id"=>$data->primaryKey))',

		),

		/*array(

			'name'=>'Titel',

       		'type'=>'raw',

			'value'=>'CHtml::ajaxLink(CHtml::encode($data->titel), array("inhaltsseite/update", "id"=>$data->primaryKey), array("update" => "#contentContainer"))',

	

		),*/

        'erstelltvonid', 

		array(       

            'name'=>'erstellt',

            'value'=>'date("m.d.y - H:i", $data->erstellt)',

        ),

		array(           

            'class'=>'CButtonColumn',

			'template'=>'{update} {delete}',

        ),

    ),

	'emptyText'=>'Keine Daten vorhanden.',

	'pager'=>array(

		'class'=>'CLinkPager',

	),

	'summaryText'=>'{start}-{end} von {count}',

	'template'=>'{items}<div class="actionBarFooter">{pager} {summary}</div>',

));

but as a result I just get: 01.01.70 - 01:00.

By using date($data->erstellt) // without "m.d.y - H:i" i receive the correct return.

Can anybody help me?

How exactly do you store dates?

For example, MySQL DateTime format (yyyy-mm-dd hh:mm:ss) or unix timestamps?

If DateTime format, I guess you need to calculate the unix timestamp first. You can do this with CDateTimeParser::parse($var, ‘yyyy-MM-dd HH:mm:ss’).

Works perfectly! Thanks a ton