Mysql Date and Time type, mysql Date and Time Type

Source: Internet
Author: User

Mysql Date and Time type, mysql Date and Time Type

Current_time display current time now () display current date and time type YEAR 1 byte 1901 ~ 2155 zero value 0000 DATE 4 byte 1000-01-01 ~ 9999-12-31 0 value 0000: 00: 00 TIME 3 bytes-838: 59: 59 ~ 838: 59: 59 zero value 00: 00: 00 DATETIME 8 byte 1000-01-01 00:00:00 ~ 9999-12-31 23:59:59 0 value 0000-00-00 00: 00: 00 TIMESTAMP 4 byte 19700101080001 ~ 20380119111407 00000000000000 Note: When the inserted data exceeds the range, the zero value will be inserted into the database table YEAR Type Insert format 0000 or "0000" TIME Type Insert format "d hh: MM: SS "(This must be enclosed in quotation marks." D "indicates the number of days, and" D * 24 "indicates the number of hours), or digit format HHMMSS or string format "HHMMSS" (both of which have the same quotation marks). The display format is HH: MM: SS, And the separator cannot use other symbols, the minute and second ranges from 0 ~ 59, the hour range is 0 ~ 23 examples: Insert "2 23:50:50", "22:22:22", "11: 11", "2 20", "30" results: 71: 50: 50, 22: 22: 11: 11: 00,68, 00: 00: 30date Type Insert format: "YYYY-MM-DD" or "YYYYMMDD" Format String representation, and any punctuation can also be used as a separator such: '@', '*', and the display format is YYYY-MM-DD. Datetime Type Insert format: "YYYY-MM-DD HH: MM: SS" or "YYYYMMDDHHMMSS", display format: "YYYY-MM-DD HH: MM: SS ", in addition, any punctuation marks can also be used as separators in the timestamp format. The date and time insertion formats and display formats are the same as those in the datetime type. The date range is smaller than that in the datetime type. Any punctuation can also be used as a separator. Enter CURRENT_TIMESTAMP or NULL or no input to insert the current date and time to the system. Note: This type of time is displayed based on the time zone. For example, the time inserted in the GMT + 14:21:25 is 13:21:25, and the time displayed in the GMT + is.

Related Article

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.