|
|
|
Topic |
What are the Date and Time data types?
|
|
Explanation |
Date and Time Data Types :
DATE :
A Date. The range is 1000-01-01 to 9999-12-31. The date values are displayed in YYYY-MM-DD format.
TIME :
A Time. The range is -838:59:59 to 838:59:59. The time values are displayed in HH:MM:SS format.
DATETIME :
A Date and Time combination. The range is 1000-01-01 00:00:00 to 9999-12-31 23:59:59. The datetime values are displayed in YYYY-MM-DD HH:MM:SS format.
TIMESTAMP :
A Timestamp. The range is 1970-01-01 00:00:01 UTC to partway through the year 2037. A TIMESTAMP column is useful for recording the date and time of an INSERT or UPDATE operation.
YEAR :
A Year. The year values are displayed either in two-digit or four-digit format. The range of values for a four-digit is 1901 to 2155. For two-digit, the range is 70 to 69, representing years from 1970 to 2069.
For all the date and time columns, we can also assign the values using either string or numbers.
|
MySQL is the most popular open source database Management system. Being a open source anyone can use and change the software for their needs. Hope you enjoy this tutorial. We welcome your Valuable feedbacks or suggestions on this MySQL tutorial. This is a copyright content.
|
|
|
|