thinkphp5.1格式化mysql时间戳为日期的多种方式

方式一      使用mysql函数FROM_UNIXTIME(unix_timestamp,format)直接转换 select FROM_UNIXTIME(o.create_time,'%Y-%m-%d') create_time from table 方式二 使用模型获取器 withAttr, 在该方法中用date函数格式化 ->field('*') ->withAttr('create_t
相关文章
相关标签/搜索