TIME type
MySQL DATETIME or TIMESTAMP data types are used to represent specific times at particular dates. How about storing only the time of the day or the time difference between two events? MySQL's TIME data type serves the purpose.
The standard MySQL format for storing or displaying TIME data type values is HH:MM:SS. The time value represents the time of the day, which is less than 24 hours, but the TIME data type, as mentioned earlier, can also be used to stored elapsed time or time difference between two events. So, the TIME column can store values greater than 24 hours.
The MySQL TIME column is defined as follows:
column_name TIME;
The range of values that can be stored in the TIME data type column is -838:59:59 to 838:59:59.
The MySQL ...
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