About the three date types in MySQL
After two insert date types recently, the value is 0000-00-00 00:00:00, so I checked the official documentation and found the reason.
In Mysql, we often use three data types to store dates: Date, Datetime, and Timestamp.
The Date data type is used to store dates without time. Mysql gets and displays this type in the format of YYYY-MM-DD ". The supported time range is "1000-00-00" to "9999-12-31 ".
Datetime stores data with both date and time. The storage and display format is YYYY-MM-DD HH: MM: SS ". The supported time range is "1000-00-00 00:00:00" to "9999-12-31 23:59:59 ".
The Timestamp type also stores data with both dates and time. The storage and display formats are the same as those of Datetime. The supported time range is "00:00:01" to "03:14:07 ".
All data that does not conform to the preceding format will be converted to a value of 0 of the corresponding type. (Or 0000-00-00 00:00:00)
-------------------------------------- Split line --------------------------------------
Install MySQL in Ubuntu 14.04
MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF
Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL
Build a MySQL Master/Slave server in Ubuntu 14.04
Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS
Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04
MySQL-5.5.38 universal binary Installation
-------------------------------------- Split line --------------------------------------
This article permanently updates the link address: