Date data types in MySQL SQL Installation Table & Records Data Types
DATE only
Format : YYYY-MM-DD
Range of values:'1000-01-01' to '9999-12-31'
Example : News_date DATE
By default MySQL store in YYYY-MM-DD format
DATETIME [fsp]
Range of value : '1000-01-01 00:00:00.000000' to '9999-12-31 23:59:59.999999'
Example : News_datetime DATETIME
fsp: is the fraction of second from .000000 to .999999
TIME
Range of value : '00:00:00.000000' to '23:59:59.999999'
Example : News_time TIME
fsp: is the fraction of second from .000000 to .999999
TIMESTAMP
values are stored as the number of seconds since the epoch ('1970-01-01 00:00:00' UTC)
fsp: is the fraction of second from .000000 to .999999
YEAR
Value of year is stored as YYYY.
← Create Table
DataType Numeric→
Copy Table & SHOW CREATE Table→
← Data Types
Author & Instructor at
plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery,
and web development at plus2net. The tutorials focus on clear explanations, working
examples, and code that readers can test and adapt while learning.
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com