Skip to main content

encode_datetime2

Function encode_datetime2 

Source
pub fn encode_datetime2(dt: &DmDateTime) -> Vec<u8> ⓘ
Expand description

DATETIME2 编码:DATE(3B) + TIME 6B(纳秒 30 位直接存储,非 ×1000;与 decode_datetime2 互逆) 时间部分 b0/b1/b2-低位 与 5 字节 TIME 一致,b2 高 7 位/b3/b4/b5 存纳秒: nsec = (b2>>1 &0x7F) + (b3<<7) + (b4<<15) + (b5&0x7F)<<23