Differences between smalldatetime and datetime

Source: Internet
Author: User
In SQL Server, smalldatetime can only be accurate to minutes, while datatime can be precise to 3% seconds (3.33 milliseconds ).

Smalldatetime usage4The first two bytes store the base date (January 1, January 1, 1900)AfterThe number of days. The last two bytes are stored after midnightMinutes.

Datetime usage8The first four bytes store the base date (January 1, 1900)BeforeOrAfterThe number of days, the last four bytes are stored after midnightMilliseconds.

Since the precision of datetime is 3% seconds, this involves decimal places. It can be a colon or a decimal point before milliseconds. It indicates the meaning of the colon at the same time, and 11: 11: 11: 21 indicates021Milliseconds. The preceding 0 is omitted, while the decimal point indicates the mathematical decimal point, for example, 11:11:11. 21.210Milliseconds. The value is omitted from the following 0.

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.