There are several types of data that represent dates and times in MySQL. Where year represents the years, date represents the dates, time represents the times, and datetime and timestamp represent dates and practices. Their comparison is as follows:
Year, byte number 1, Value range "1901--2155"
DATE, byte number 4, Value range "1000-01-01--9999-12-31"
Time, byte number 3, value range " -838:59:59--838:59:59"
DATETIME, byte number 8, value range "1000-01-01 00:00:00--9999-12-31 23:59:59"
TIMESTAMP, byte number 4, Value range "19700101080001--20380119111407"
When the insertion value exceeds a valid range of values, the system will error and insert a value of 0 into the database.
Date in date format: YYYY-MM-DD
Date and time in datetime format: YYYY-MM-DD hh:mm:ss
Timestamp format date and time: YYYYMMDDHHMMSS
Some issues with MySQL time fields