版权声明:转载请注明出处 https://blog.csdn.net/DuanLiuchang/article/details/79583405
MySQL往数据库插时间格式的数据时,只保存年月日,不保存时分秒。
看看建表时是否将该字段设成了date类型
试试将该字段类型改为datetime类型
顺带记录一下时间的格式化函数
date_format(now(), '%Y-%m-%d %H:%i:%s')
扫描二维码关注公众号,回复:
4984301 查看本文章
MySQL往数据库插时间格式的数据时,只保存年月日,不保存时分秒。
看看建表时是否将该字段设成了date类型
试试将该字段类型改为datetime类型
顺带记录一下时间的格式化函数
date_format(now(), '%Y-%m-%d %H:%i:%s')