MySQL Build database datetime, DATE, and timestamp differences

Source: Internet
Author: User

Http://blog.sina.com.cn/s/blog_5f7b8c2c0100tf6t.html DATETIMEDATEand TIMESTAMP  the type are similar. This article describes their characteristics and their similarities and differences.

DATETIMEThe type can be used for values that need to contain both date and time information.

MySQL to   ' yyyy-mm-dd HH:MM:SS '   to   ' 9999-12-31 23:59:59 ' . (The meaning of "support" is that although earlier values may work, there is no guarantee that they can.) )

DATEThe type can be used when a date value is required instead of the time portion. MySQL ‘YYYY-MM-DD‘ retrieves and displays values in a format DATE . The scope of support is ‘1000-01-01‘ to ‘9999-12-31‘ .

TIMESTAMPThe column type provides a type through which you can automatically mark Insert or Update manipulate the date and time of the current operation . If there are multiple columns in a table TIMESTAMP , only the first one is automatically updated.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.