I need a generic rule that will convert the binary representation of a date into the actual date.
The program that creates the binary data is written in delphi if that helps, but unfortunately it is not in the best interests of its author to help me read the file.
Hence I need to figure it out.
Weird thing is it seems to be stored as 10 bytes, not 8, or 4.
(There is actually 11, the first one is always 0x05, but I've deduced that that just means "there follows a date")
Here are some examples :
I can create more examples to test, but not automatically, hence generation of a lookup table is not possible.
"yyyy/MM/dd" :
"1965/04/23" = { 0x00, 0xC8, 0x7E, 0x51, 0x0C, 0xC0, 0x5F, 0xBA, 0x0D, 0x40 }
"1999/12/15" = { 0x00, 0x60, 0xBF, 0x28, 0x06, 0xE0, 0x9D, 0x8E, 0x0E, 0x40 }
"1900/01/01" = { 0x00, 0x00, 0x00, 0xDE, 0x2F, 0x8A, 0x01, 0xB8, 0x00, 0x40 }
"1899/12/31" = { 0x00, 0x00, 0x00, 0xBC, 0x5F, 0x14, 0x03, 0xF0, 0xFF, 0x3F }
"1899/12/29" = { 0x00, 0x00, 0x00, 0xBC, 0x5F, 0x14, 0x03, 0xF0, 0xFF, 0xBF }
"1899/12/30" = { 0x00, 0x00, 0x00, 0x78, 0xBF, 0x28, 0x06, 0xE0, 0xFE, 0x3F }
"1825/01/01" = { 0x00, 0xf0, 0x7e, 0x51, 0x0c, 0xc0, 0xff, 0xd5, 0x0d, 0xc0 }
"1820/01/01" = { 0x00, 0xf0, 0x7e, 0x51, 0x0c, 0xc0, 0x45, 0xe4, 0x0d, 0xc0 }
"1815/01/01" = { 0x00, 0xf0, 0x7e, 0x51, 0x0c, 0xc0, 0x89, 0xf2, 0x0d, 0xc0 }
"1965/04/22" = { 0x00, 0xF0, 0x7E, 0x51, 0x0C, 0xC0, 0x5D, 0xBA, 0x0D, 0x40 }
"1965/04/21" = { 0x00, 0xF0, 0x7E, 0x51, 0x0C, 0xC0, 0x5B, 0xBA, 0x0D, 0x40 }
"1810/01/01" = { 0x00, 0x78, 0xbf, 0x28, 0x06, 0xe0, 0x66, 0x80, 0x0e, 0xc0 }
"1805/01/01" = { 0x00, 0x78, 0xbf, 0x28, 0x06, 0xe0, 0x88, 0x87, 0x0e, 0xc0 }
"1752/09/14" = { 0x00, 0x78, 0xBF, 0x28, 0x06, 0xE0, 0x25, 0xD2, 0x0E, 0xC0 }
"1752/09/15" = { 0x00, 0x78, 0xBF, 0x28, 0x06, 0xE0, 0x24, 0xD2, 0x0E, 0xC0 }
"1752/10/22" = { 0x00, 0x78, 0xBF, 0x28, 0x06, 0xE0, 0xFF, 0xD1, 0x0E, 0xC0 }
"1752/10/21" = { 0x00, 0x78, 0xBF, 0x28, 0x06, 0xE0, 0x00, 0xD2, 0x0E, 0xC0 }
"1752/10/20" = { 0x00, 0x78, 0xBF, 0x28, 0x06, 0xE0, 0x01, 0xD2, 0x0E, 0xC0 }
"1752/10/19" = { 0x00, 0x78, 0xBF, 0x28, 0x06, 0xE0, 0x02, 0xD2, 0x0E, 0xC0 }
"1753/10/19" = { 0x00, 0x78, 0xBF, 0x28, 0x06, 0xE0, 0x95, 0xD0, 0x0E, 0xC0 }
"1800/01/01" = { 0x00, 0x78, 0xBF, 0x28, 0x06, 0xE0, 0xAA, 0x8E, 0x0E, 0xC0 }
edit: 14th september 1752 is the earliest date the program will allow me to put in, hence that is the earliest example I can give. Curiously 2nd - 14th septermber 1752 did not exist, apparently. I'm not sure why this is, or why the program cares.