Help with CGridView date format

Hello,

I cannot get the date to display in am/pm on the GridView.

What am I doing wrong?

Dates displayed as 12/31/1969




array(      

            'name'=>'date',

            'value'=>'date("m/d/Y h:m a", $data->date)',

        ),

Thank you

how do you save your date in database ?

anyway, if you save it as a 10 digit integer,

‘value’=>‘date(“Y-m-d h:m a”,$data->date)’, should do it,

else

‘value’=>‘date(“Y-m-d h:m a”,strtotime($data->date))’,

Also, watch out on the quotes (single vs double) because the expression is passed to eval, so you can even take a php file and test in there the result of eval(‘your code here’) then when you get it right, pass it to yii.

Thank You so much.

Date is stored as datetime in mysql.

strtotime was the ticket.

-Frank

Thanks so much :)

[QUOTE]how do you save your date in database ?

anyway, if you save it as a 10 digit integer,

‘value’=>‘date(“Y-m-d h:m a”,$data->date)’, should do it,

else

‘value’=>‘date(“Y-m-d h:m a”,strtotime($data->date))’,

Also, watch out on the quotes (single vs double) because the expression is passed to eval, so you can even take a php file and test in there the result of eval(‘your code here’) then when you get it right, pass it to yii.[/QUOTE]

THIS WORKS