I need to decode a data structure containing date and time.
Most of the fields (month, minute, hour and so on) are single bytes and thus are no problem to extract.
However the year is formatted as two bytes, with the following description:
clock data, year[7:0] Time: Year (16bit, LSB)
clock data, year[15:8] Time: Year (16bit, MSB
The two bytes I have extracted form the structure is as follows:
0xDB 0x07
And the year should be correct (the other fields are reasonable correct).
Anyone have an idea how it should be decoded?
0xDB 0x07 -> “0x07DB” = 2011
swap bytes and you have the year value.