Open trinkity opened 7 years ago
In my case $model->date = 2017-06-22 13:19:56 but it is showing 2017-06-27 18:49:56 i.e it is adding +5:30 which is my time zone. How to disable adding timezone before displaying time.?
Same problem. Is there a solution?
Got the same problem. I solved the problem by setting the defaultTimeZone settings in the formatter component in accordance with the settings for the date.timezone parameter in php.ini
'formatter' => [
'dateFormat' => 'php:d.m.Y',
'datetimeFormat' => 'php:d.m.Y H:i:s',
'timeFormat' => 'php:H:i:s',
'defaultTimeZone' => 'Europe/Moscow',
'locale' => 'ru-RU',
'nullDisplay' => '',
],
Got the same problem. I solved the problem by setting the defaultTimeZone settings in the formatter component in accordance with the settings for the date.timezone parameter in php.ini
'formatter' => [ 'dateFormat' => 'php:d.m.Y', 'datetimeFormat' => 'php:d.m.Y H:i:s', 'timeFormat' => 'php:H:i:s', 'defaultTimeZone' => 'Europe/Moscow', 'locale' => 'ru-RU', 'nullDisplay' => '', ],
Where do you set this in the widget? Or what is it you are talking about here?
Where do you set this in the widget? Or what is it you are talking about here?
it's the formatter component's settings inside app configuration https://www.yiiframework.com/doc/guide/2.0/en/structure-applications#components
My $model->date_s = 2017-03-06 19:00:00
But the input field default is 2017-03-06T20:00:00+0100
if in phpDatetimeFormat i insert eg yyyy-MM-DD HH:mm:ss i've error because is not in your protected $defaultPhpMomentMapping
this is the config ` $form->field($model_post, 'schedule')->widget(