Gridview datetime has wrong hour

Hi all, I’ve google and looked through just about everything I can find about formatting datetime in Yii2 but I’m still having an issue with getting the correct time (hour) to display in my GridView.

Database has this data stored:

2017-02-10 09:19:39

2017-02-08 15:39:44

But this is what is displayed:

02/10/17 03:19AM (should be 9:19am)

02/08/17 09:39AM (should be 3:39pm)

I’ve check my time zone and it’s correct in terms of where I’m at.

Using this code (value is state_date):

<?= GridView::widget([


    'dataProvider' => $assignedTicketsData,


    'id' => 'assigned-tickets',


    'summary' => '',

// ‘filterModel’ => $searchModel,

    'rowOptions' => function ($model, $key, $index, $grid) {


        return ['data-id' => $model->id, 'class' => 'grid-row'];


    },


    'columns' => [


        //['class' => 'yii\grid\SerialColumn'],


        'title',


        'type',


        'artist',


        [


            'attribute' => 'state_name',


            'label' => 'State',


            'value' => 'state.name',


        ],


        'state_date:datetime',


        //['class' => 'yii\grid\ActionColumn'],


    ],


]); ?>

Update: I figured it out.

in web.php:

    'formatter' => [


        'class' => 'yii\i18n\Formatter',


        'dateFormat' => 'php:m/d/y',


        'datetimeFormat' => 'php:m/d/y g:ia',


        'timeFormat' => 'php:g:i:s',


        'defaultTimeZone' => 'America/Chicago',


    ],

I had the timeZone set outside of that like this:

'timeZone' => 'America/Chicago',

and apparently it needs to be set in formatter instead.