The difference between creation time and update time in mysql

1timestamp

1.1 Statement

`create_time` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` timestamp(0) NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',

1.2 In the mysql tool of the interface,

1.2.1 Creation time

Insert picture description here

1.2.1 Update time

Insert picture description here

2datetime

ALTER TABLE `user`
MODIFY COLUMN create_time datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT "创建时间";
 
ALTER TABLE `user`
MODIFY COLUMN `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT "更新时间";

Guess you like

Origin blog.csdn.net/Insist___/article/details/109294717