content_image/850137.jpg content_image/850141.jpg content_image/850142.jpg content_image/850147.jpg
<img src='content_image/850137.jpg'>

## Date and Time Type Storage Requirements 

For TIME , DATETIME , and TIMESTAMP  columns, the storage required for tables created before MySQL 5.6.4 differs from tables created from 5.6.4 on. This is due to a change in 5.6.4 that permits these types to have a fractional part, which requires from 0 to 3 bytes. 

<img src='content_image/850141.jpg'>

As of MySQL 5.6.4, storage for YEAR  and DATE  remains unchanged. However, TIME , DATETIME , and TIMESTAMP  are represented differently. DATETIME  is packed more efficiently, requiring 5 rather than 8 bytes for the nonfractional part, and all three parts have a fractional part that requires from 0 to 3 bytes, depending on the fractional seconds precision of stored values. 

<img src='content_image/850142.jpg'>

For example, TIME(0) , TIME(2) , TIME(4) , and TIME(6)  use 3, 4, 5, and 6 bytes, respectively. TIME and TIME(0)  are equivalent and require the same storage. 

For details about internal representation of temporal values, see MySQL Internals: Important Algorithms and Structures. 

## String Type Storage Requirements 

In the following table, M  represents the declared column length in characters for nonbinary string types and bytes for binary string types. L  represents the actual length in bytes of a given string value. 

<img src='content_image/850147.jpg'>

