custom admin grid is showing incorrect date & time .in my database its showing correct also in view detail page its showing correct but in my grid its showing incorrect
Database Date is : 2015-04-10 21:10:54
Grid date is showing incorrect : Apr 10, 2015 4:20:45 PM
I am using the below Code in my grid :
$this->addColumn('created_date', array(
'header' => Mage::helper('mymodule')->__('Date'),
'align' => 'left',
'type' => 'datetime',
'index' => 'created_date',
'width' => '150px',
));
at the time of save the date i am using the below Code :
'created_date'=>date('Y-m-d H:i:s')
,
its showing in database correct but in grid its showing incorrect
Any Help much be appreciated
Best Answer
You can pass the format option to your colum definition. Your column definition should look like
Then the date is displayed correctly in the grid.