In the DB I have a datetime column in the format of yyyy-mm-dd hh:mm:ss.
in DynaGrid I"m using the format of the column like that: 'format' => ['date', 'php:d-m-Y H:i:s'].
The result is that one hour is being added to the DB value.
When I"m using a date_default_timezone_set definition, three hours is being add to the DB value.
How I can overcome it and display the correct DB value in the requested format?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi,
In the DB I have a datetime column in the format of yyyy-mm-dd hh:mm:ss. in DynaGrid I"m using the format of the column like that: 'format' => ['date', 'php:d-m-Y H:i:s']. The result is that one hour is being added to the DB value. When I"m using a date_default_timezone_set definition, three hours is being add to the DB value. How I can overcome it and display the correct DB value in the requested format?
[ 'attribute' => 'messageHistoryTime', 'format' => ['date', 'php:d-m-Y H:i:s'], 'filterType' => GridView::FILTER_DATE_RANGE, 'width' => '15%', 'filterWidgetOptions' => [ 'presetDropdown' => true, 'pluginOptions' => [ 'format' => 'DD-MM-YYYY', 'separator' => ' TO ', 'opens' => 'left', 'locale' => ['format' => 'DD-MM-YYYY'], ], 'pluginEvents' => [ "apply.daterangepicker" => "function() { apply_filter('messageHistoryTime') }", ] ], ],
Thanks in advance, Yair