First, the date type
It indicates the type of date and time is a time value DATETIME, DATE, TIMESTAMP, TIME, and YEAR.
Each type has a value of time effective range and a "zero" value of "zero" when the value of the specified unlawful MySQL can not be represented.
Types of | Size (bytes) | range | format | use |
---|---|---|---|---|
DATE | 3 | 1000-01-01/9999-12-31 | YYYY-MM-DD | Date values |
TIME | 3 | ‘-838:59:59’/‘838:59:59’ | HH:MM:SS | Time value or duration |
YEAR | 1 | 1901/2155 | YYYY | Year Value |
DATETIME | 8 | 1000-01-01 00:00:00/9999-12-31 23:59:59 | YYYY-MM-DD HH |