首页 > 数据库技术 > 详细

mysql保存当前时间精确到秒

时间:2014-07-02 15:15:21      阅读:459      评论:0      收藏:0      [点我收藏+]

   用mybatis在mysql中保存字段精确到秒需要两个步骤。

1、现在mysql中将时间字段改为datetime 例如:alter table tablename add pay_date datetime comment ‘精确到秒的时间‘

2、在sql语句中直接用now().  例如:        update tj_record set   is_customerHandover =‘1‘ and customer_handover_date = now() where id = #{record_id}



mysql保存当前时间精确到秒,布布扣,bubuko.com

mysql保存当前时间精确到秒

原文:http://blog.csdn.net/zl544434558/article/details/36410811

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!