mysql保存当前时间精确到秒
用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}
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。