0

I created one grid and showed the date there. Database data and grid values are not matched. Grid value showing 1 back date instead of same as database.

Below is my DB table value:

enter image description here

And below code snippet I am using for grid column value:

$this->addColumn('process_ship_date', array(
            'header'    => __('Process Ship Date'),
            'type'      => 'date',
            'index'     => 'process_ship_date'
        ));

And below are my grid value:

enter image description here

Also, the date format does not match in Grid.

Can anyone please look into this.

2 Answers 2

1

Magento Store Date in UTC format in Database. While in Grid it will convert from UTC to Your magento store time.

So, save date in database in UTC format.

1

If you want to render a date without timezone changes just add property timezone to column

        $this->addColumn('process_ship_date', array(
            'header'    => __('Process Ship Date'),
            'type'      => 'date',
            'timezone'  => false,
            'index'     => 'process_ship_date'
        ));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.