The Date type is used for values with a data part but no time part, MySQL retrieves and displays DATE values in ‘YYYY-MM-DD’ format. The supported range is ‘1000-01-01’ to ‘9999-12-31’.
The DATETIME type is used for values that contains 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’
The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of ‘1970-01-01 00:00:01’ UTC to ‘2038-01-19 03:14:07’ UTC
Besides the above three types of TIME TYPE DATA, there is also a TIME type, in ‘HH:MM:SS’ format.
本文深入探讨了MySQL中的DATE、DATETIME和TIMESTAMP数据类型的特点与应用范围,包括它们的时间格式支持范围以及如何在实际项目中灵活运用。
9530

被折叠的 条评论
为什么被折叠?



