Answer the question
In order to leave comments, you need to log in
Problem with time zone in kartik\datecontrol\DateControl?
I use kartik\datecontrol\DateControl to save
the date by -3 hours and, accordingly, when I edit it, it shows yesterday. who faced?
echo $form->field($model, 'date_started')->widget(DateControl::classname(), [
'type'=>DateControl::FORMAT_DATE,
'value' => $selected_date_started,
// 'displayFormat' => 'php: d.m.Y',
// 'saveFormat' => 'php:U',
'ajaxConversion'=>true,
// 'displayTimezone' => 'Etc/GMT+6',
// 'saveTimezone' => 'Etc/GMT+6',
'widgetOptions' => [
'layout' => '{input}{remove}{picker}',
'pluginOptions' => [
'autoclose' => true,
'todayHighlight' => true,
'todayBtn' => true,
],
]
])->label('Дата начала');
Answer the question
In order to leave comments, you need to log in
Check how realistic it is in the database, at what stage "-3 hours" occurs. I advise you to check the timezone in mysql, it's best to have +0 there. And already at the level of yii and the DateControl module itself, specify the necessary timezones in the config
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question