举个例子:字段datetime类型:0000-00-00 00:00:00.000
orm查询后得到:0000-00-00 00:00:00,为什么丢失了微秒,请问有什么解决办法吗?
5 回答

一只萌萌小番薯
TA贡献1795条经验 获得超7个赞
什么样的业务数据需要精确到微妙?能简单就简单点吧。。。
使用修改器
:
public function getDatetimeAttribute($value)
{
$this->attributes['datetime'] = date('xxxxx', strtotime($value));//这里日期转成带毫秒的格式(未测试)
}
- 5 回答
- 0 关注
- 739 浏览
添加回答
举报
0/150
提交
取消