mysql datetime存储数据格式

https://dev.mysql.com/doc/internals/en/date-and-time-data-type-representation.html

譬如:

 1 bit  sign           (1= non-negative, 0= negative)
17 bits year*13+month  (year 0-9999, month 0-12)
 5 bits day            (0-31)
 5 bits hour           (0-23)
 6 bits minute         (0-59)
 6 bits second         (0-59)
---------------------------
40 bits = 5 bytes

大端存储big endian.

99a188f8bb

转换为2进制:
1   00110011010000110   00100  01111  100010     111011
       2018*13+12       4日     15点     33分         35秒  

你可能感兴趣的:(java,mysql)