Internal representation of the DATE datatype

As with other datatypes, stored DATEs are always preceded by a length byte.
The length byte is 0xFF for NULLs, or 7 bytes for known DATEs.
The internal representation of DATEs is quite simple
and can be easily seen using the dump function as follows.

The first two bytes represent the century and year respectively.
Each of these bytes have an offset of 100 to allow for the negative centuries and years required for BC dates.
For example, the byte pair 96,8 would represent the year 492 BC (the year of the battle of Marathon).
The 3rd and 4th bytes represent the month and the day of that month respectively.
The last three bytes represent the hour, minute, and second.
Each of these time bytes have an offset of 1 to ensure that dates can never contain null bytes.
So the contents of the seven bytes are as follows.

Here the datatype number is 13, instead of 12.
The memory structure has been padded to a 4-byte boundary.
The time bytes do not have any offset.
And the century and year are represented as a single signed two byte number.
Because this dump was taken on a machine with a little-endian architecture,
the bytes are reversed and should be read as 7,210 or 0x7D2, which is decimal 2002.
The corresponding bytes for 492 BC would be 20,254.
That reverses to 254,20 or 0xFE14, which is -492 in two's complement notation.
These details are of course platform specific.