gpt4 book ai didi

mysql - 如何在数据库中存储当前时间

转载 作者:行者123 更新时间:2023-11-29 07:08:46 25 4
gpt4 key购买 nike

我想在 mysql 中有一个必须自动生成当前时间的字段,比如记录插入到其中的时间。

请帮帮我..........

最佳答案

来自 MySQL :

In a CREATE TABLE statement, the first TIMESTAMP column can be declared in any of the following ways:

With both DEFAULT CURRENT_TIMESTAMP and ON UPDATE

CURRENT_TIMESTAMP clauses, the column has the current timestamp for its default value, and is automatically updated.

关于mysql - 如何在数据库中存储当前时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5828661/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com