kartik-v / yii2-widget-datetimepicker

Enhanced Yii2 wrapper for the bootstrap datetimepicker plugin (sub repo split from yii2-widgets)
Other
105 stars 54 forks source link

Inputs are saved hours after #31

Closed xiandalisay closed 8 years ago

xiandalisay commented 9 years ago

After inputing the datetime values, the values saved are one to two hours after. I didnt touch beforeSave() capture capture2

jhebb commented 9 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?

jhebb commented 9 years ago

Definitely seems to be defaulting to UTC for me, which is +3hrs.

xiandalisay commented 9 years ago

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}" ],

xiandalisay commented 9 years ago

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 .

jhebb commented 9 years ago

I'm not using detailview to display my data, it's just an ActiveField input but I'll see if it's related.

jhebb commented 8 years ago

Setting formatter['defaultTimeZone'] in the config to my time zone corrected this issue for me.