Date and time data types can hold dates, times, and combinations of dates and time, timestamps, and years. This section walks you through the different date and time data types in MySQL. This section also shows you where Oracle, PostgreSQL, and SQL Server date and time data types are different.
Understanding date and time data types
Date and time data types in MySQL
The date and time data types in MySQL include:
- DATE: This data type can hold a date in the format of YYYY-MM-DD. The range is from '1000-01-01' to '9999-12-31'. For example, December 15, 1997, would be stored as 1997-12-15.
- TIME: This data type holds time values in the format of hh:mm:ss. The range is from '-838:59:59' to '838...