如何将一组4位的字符,转成shortdate的时间?
收到的字符十六进制如下
D9 67 18 01 ---对应20090312
D9 67 5A 01 ---对应20090313
如何实现呢?我根据说明是这4byte一组 shortdate 我把收到的字符转成二进制,然后根据bits位数
组合13bits为年,4bits为月,5bits为天,但是算出来的数据对不上实际结果的日期呀
搞不明白了,请教哪位达人做过类似的算法?
struct SHORTDATE { // Date field (4 bytes)
ULONG Year : 13; // Year (13 bits)
ULONG Month : 4; // Month (4 bits)
ULONG Day : 5; // Day (5 bits)
ULONG WeekDay : 3; // Weekday (3 bits)
ULONG reserved : 7; // reserved (7 bits)
}