lapmzmf
- lapmzmf 2016-11-21 已签到连续签到2天,获得了10个金钱
model里写的getDate,setDate方法,方法里做转换,前台model使用date
public function getDateTime(){ $data = date('lxxx', $this->时间戳字段) return $date; } public function setDateTime($str){ $this->时间戳 = strtotime($str); }
选择时间框,绑定的是dateTime
@jackiegao 昨晚又想了想,确实如你所说,还是您的方法比较好,谢谢指教。
model里写的getDate,setDate方法,方法里做转换,前台model使用date
public function getDateTime(){ $data = date('lxxx', $this->时间戳字段) return $date; } public function setDateTime($str){ $this->时间戳 = strtotime($str); }
选择时间框,绑定的是dateTime
代码如下:
<?= $this->render('_form', [$model->card_time = date('Y-m-d',$model->card_time), $model->cyber_time = date('Y-m-d',$model->cyber_time), $model->account_time = date('Y-m-d',$model->account_time), 'model' => $model, ]) ?>
model里写的getDate,setDate方法,方法里做转换,前台model使用date
public function getDateTime(){ $data = date('lxxx', $this->时间戳字段) return $date; } public function setDateTime($str){ $this->时间戳 = strtotime($str); }
选择时间框,绑定的是dateTime
已经更改,我刚发现了一个方法,下午那会用错了date函数,您这种我也试了,可以实现,谢谢。我是在update提交给表单前对其进行了转化。
http://www.bootcss.com/p/bootstrap-datetimepicker/
http://www.runoob.com/jqueryui/example-datepicker.html
做程序,文档都不去看。。。。。。。。。。。。。。。您可能没有理解我的意思,我是说在yii2框架中的哪个位置去对获取到的时间数据进行处理?新增的时候,我已经处理好了。
- lapmzmf 2016-11-20 已签到连续签到1天,获得了5个金钱
- lapmzmf 2016-11-17 已签到连续签到38天,获得了20个金钱
- lapmzmf 2016-11-18 已签到连续签到39天,获得了20个金钱
- lapmzmf 发表了说说因为需要了解了下ASP.NET的MVC框架,YII是参考MVC框架作的吗?