Date and time data types
DATE, TIME, DATETIME, TIMESTAMP, and YEAR form the group of date and time data types for storing temporal values. Each of these types has a range of permitted values. Apart from the permitted values, a special zero value can also be used to specify an invalid value which MySQL cannot represent. The zero value can be 00-00-0000. MySQL allows this value to be stored in a date column. This is sometimes more convenient than storing NULL values.
The following are the general considerations we must take care of while working with date and time types.
The way MySQL treats storage and retrieval operations for date or time types is different in the context of the format. Basically, for a date or time type value stored in the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access