MySQL Time storage type pros and cons? Datetime? Timestamp?int?

Source: Internet
Author: User

TIMESTAMP

4 bytes of storage; values are saved in UTC format;. Time zone conversion, which transforms the current time zone when it is stored, and then converts it back to the current time zone.

Datetime

8 bytes stored, actual format stored, time-zone independent, DateTime retrieves and displays datetime values in ' yyyy-mm-dd HH:MM:SS ' format. The supported range is ' 1000-01-01 00:00:00 ' to ' 9999-12-31 23:59:59 ' timestamp value cannot be earlier than 1970 or later than 2037

Int

Save time stamp. Low resource usage and fast query speed. Condition range Search using between no problem. Query conditions free splicing.

DateTime and timestamp have a small advantage over int, which means that there are a number of time functions that can be used for a time type.

MySQL Time storage type pros and cons? Datetime? Timestamp?int?

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.