May 2020
Beginner
564 pages
14h 9m
English
The following table lists the date and time data types available in MySQL:
| Data Type | Description | Storage Used |
| DATE | Stores dates in the format 'YYYY-MM-DD' Ranges from '1000-01-01' to '9999-12-31' | 3 bytes |
| TIME | Stores time in format: hh:mm:ss Ranges from '-838:59:59' to '838:59:59' | 3 bytes |
| DATETIME | Stores date and time combination in format YYYY-MM-DD hh:mm:ss Ranges from '1000-01-01 00:00:00' to '9999-12-31 23:59:59' | 8 bytes |
| TIMESTAMP | Stores time in number of seconds since '1970-01-01 00:00:00' UTC Ranges from '1970-01-01 00:00:01' UTC to '2038-01-09 03:14:07' UTC | 4 bytes |
| YEAR | Stores year in four-digit format Ranges from 1901 to 2155, and includes 0000 | 1 byte |
The preceding table ...
Read now
Unlock full access