设为首页 加入收藏

TOP

mysql保存当前时间精确到秒
2015-07-24 11:06:02 来源: 作者: 【 】 浏览:2
Tags: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}

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Mac下安装、使用MySQL 下一篇mysql在linux上的安装之三(二进制..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Linux_百度百科 (2025-12-26 12:51:52)
·Shell 流程控制 | 菜 (2025-12-26 12:51:49)
·TCP/UDP协议_百度百科 (2025-12-26 12:20:11)
·什么是TCP和UDP协议 (2025-12-26 12:20:09)
·TCP和UDP详解 (非常 (2025-12-26 12:20:06)