Closed xiandalisay closed 8 years ago
@xlandalisay this is happening to me too, i'm guessing the timezone is not getting set properly. Were you able to resolve it?
Definitely seems to be defaulting to UTC for me, which is +3hrs.
Yes, I solved it but It's a detailview issue. In this attribute, I have the format parameter set to datetime. When I removed it, it was solved. But, I still wanted it to format into a specific datetime format. Still results to "Y-m-d H:i:s" [ 'attribute'=>'to_dt', 'label'=>"To", 'format' => 'datetime', // should be delated 'value' => "{$model->to_dt}" ],
Yes, I solved it but It's a detailview issue. In this attribute, I have the format parameter set to datetime. When I removed it, it was solved. But, I still wanted it to format into a specific datetime format. Still results to "Y-m-d H:i:s" [ 'attribute'=>'to_dt', 'label'=>"To", 'format' => 'datetime', // should be delated 'value' => "{$model->to_dt}" ],
On Fri, Aug 7, 2015 at 4:10 AM, jhebb notifications@github.com wrote:
Definitely seems to be defaulting to UTC for me, which is +3hrs.
— Reply to this email directly or view it on GitHub https://github.com/kartik-v/yii2-widget-datetimepicker/issues/31#issuecomment-128491592 .
I'm not using detailview to display my data, it's just an ActiveField input but I'll see if it's related.
Setting formatter['defaultTimeZone'] in the config to my time zone corrected this issue for me.
After inputing the datetime values, the values saved are one to two hours after. I didnt touch beforeSave()