gridview - Format datetime conversion show default datetime -


i have cgridview date output 2013-03-25 13:30:00

but want in output monday 25 march 2013 1:30 pm

i have used

array('name'=>'appointment','value'=>  'date("j f y,g:i a",  strtotime("$data->appointment"))'), 

but showing 1 january 1970,1:00 am

what have missed here? please help.

don't know why strtotime doesn't work here, yii can use :

e.g. :

array(   'name'=>'appointment',   'value'=>'yii::app()->dateformatter->format("eeee d mmmm y hh:mm:ss a", cdatetimeparser::parse($data->appointment, "yyyy-mm-dd h:mm:ss"))' ), 

if want use date format elsewhere, can define getter in model.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -