# Time Data Type Comparison
__*Comparative time data types*__

| Type        | Storage | Scope                                                    |
| :---------- | :------ | :------------------------------------------------------- |
| `DATE`      | 3 bytes | 0000-01-01 to 9999-12-31                                 |
| `TIME`      | 3 bytes | -838:59:59.000000 to 838:59:59.000000                    |
| `DATETIME`  | 8 bytes | 0000-01-01 00:00:00.000000 to 9999-12-31 23:59:59.999999 |
| `TIMESTAMP` | 4 bytes | 1970-01-01 00:00:01.000000 to 2038-01-19 03:14:07.999999 |
| `YEAR`      | 1 byte  | 1901 to 2155                                             |

------------------------------------------------------------
TiDB supports all MySQL date and time types, including DATE, TIME, DATETIME, TIMESTAMP, and YEAR. Each type has a range of valid values, and a value of 0 indicates an invalid value.

Note about date and time value types:

The date part literally has to be in the format "year-month-day" (for example, 1998-09-04), not "month-day-year" or "day-month-year".

If the year part of a date is 2 digits, TiDB converts it according to the specific rule that the year is two digits.

If the format must be a numeric type, TiDB automatically converts the date or time value to a numeric type. For example:

```
tidb> SELECT NOW(), NOW()+0, NOW(3)+0;
+---------------------+----------------+--------------------+
| NOW()               | NOW()+0        | NOW(3)+0           |
+---------------------+----------------+--------------------+
| 2012-08-15 09:28:00 | 20120815092800 | 20120815092800.889 |
+---------------------+----------------+--------------------+
```
