Home  >  Article  >  Database  >  A brief summary of the data types used to represent dates in MySQL

A brief summary of the data types used to represent dates in MySQL

藏色散人
藏色散人forward
2020-04-14 11:51:102550browse

A brief summary of the data types used to represent dates in MySQL

MySQL data type representing date

Type name Date format Date range Storage requirements
YEAR YYYY 1901 ~ 2155 1 bytes
TIME HH:MM:SS -838:59:59 ~ 838:59:59 3 bytes
DATE YYYY-MM-DD 1000-01-01 ~ 9999-12-3 3 bytes
DATETIME YYYY-MM-DD HH:MM:SS 1000-01-01 00:00:00 ~ 9999-12-31 23:59:59 8 Bytes
TIMESTAMP YYYY-MM-DD HH:MM:SS 1980-01-01 00:00:01 UTC ~ 2040-01-19 03:14:07 UTC 4 bytes

Recommended: "mysql video Tutorial

The above is the detailed content of A brief summary of the data types used to represent dates in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete