gpt4 book ai didi

mysql - 无法使用mysql命令行插入日期时间

转载 作者:行者123 更新时间:2023-11-29 01:17:40 26 4
gpt4 key购买 nike

<分区>

The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'. (http://dev.mysql.com/doc/refman/5.5/en/datetime.html)

ALLOW_INVALID_DATES

Do not perform full checking of dates. Check only that the month is in the range from 1 to 12 and the day is in the range from 1 to 31. This is very convenient for Web applications where you obtain year, month, and day in three different fields and you want to store exactly what the user inserted (without date validation). This mode applies to DATE and DATETIME columns. It does not apply TIMESTAMP columns, which always require a valid date. (http://dev.mysql.com/doc/refman/5.5/en/datetime.html)

如果我输入

SHOW VARIABLES LIKE 'datetime%format';

它说:%y- %m- %d %H: %i: %s

我试图插入 1999-04-26 13:00:00 并说出了错误的语法。

我尝试在声明 DATETIME 后添加到表 *ALLOW_INVALID_DATES* 中,然后在表创建结束时尝试并出错。

我很困惑...

谢谢你的时间

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