datetime columns hold dates between January 1, 1753 and December 31, 9999. The level of granularity. Since the date of January 1, 1900 and 4 bytes for the time of day.Once again I draw attention to the fact that
datetime values ​​are accurate to 1/300 secondIn the upper 4 bytes the days are stored, and in the lower 4 bytes the time of the day. In 24 hours of the day * 60 minutes * 60 seconds * 1000 milliseconds = 86_400_000 milliseconds per day, a number that is quite 4 bytes (0x5_26_5C_00). Even for the sign bit there is a place. Somebody share, please, how is it necessary to store the time of day so that it does not fit?
datetime columns hold dates between January 1, 1753 and December 31, 9999. The level of granularity. The last digit of the second digit is always 0, 3, or 6. Other digits are rounded up; 2, 3, and 4 round to 3; 5, 6, 7, and 8 round to 6; and 9 rounds to 10, since the date of January 1, 1900 and 4 bytes: 4 bytes: 4 bytes:That is, you record an object with one timestamp, and read “almost the same, sometimes even the same”. You can even a little into the future (for a millisecond) to go if the nine falls out.
bigdatetime columns hold dates from January 1, 0001 to December 31, 9999 and 12: 00: 00.000000 AM to 11: 59: 59.999999 PM. Its storage size is 8 bytes. Bigdatetime is a 64 bit integer containing the number of microseconds since 01/01/0000.
Source: https://habr.com/ru/post/303052/
All Articles