Discussion:
Decoding a date & time format
(too old to reply)
Rob Nicholson
2008-10-28 12:00:57 UTC
Permalink
Not sure if this is a good place to post, but we're trying to reverse
engineer an Oracle database which has two fields for date & time. They don't
seem to be encoded using the standard Oracle date/time fields so we suspect
the developer has used some bespoke encoding system.

So I thought it would be a good challenge for somebody mathematically
minded.

The example I currently have is:

17th October 2008 encoded as 131598865
13:54:49 encoded as 221655296

I'll try and get some more examples.

Any help appreciated.

Thanks, Rob.
Phil Carmody
2008-10-28 13:51:07 UTC
Permalink
Post by Rob Nicholson
Not sure if this is a good place to post, but we're trying to reverse
engineer an Oracle database which has two fields for date & time. They don't
seem to be encoded using the standard Oracle date/time fields so we suspect
the developer has used some bespoke encoding system.
So I thought it would be a good challenge for somebody mathematically
minded.
17th October 2008 encoded as 131598865
Hexadecimal: 0x07D80A11
And:
07D8 = 2008
0A = 10
11 = 17
Post by Rob Nicholson
13:54:49 encoded as 221655296
Hexadecimal: 0x0D363100
And:
0D = 13
36 = 54
31 = 49


Phil
--
Christianity has such a contemptible opinion of human nature that it does
not believe a man can tell the truth unless frightened by a belief in God.
No lower opinion of the human race has ever been expressed.
-- Robert Green Ingersoll (1833-1899), American politician and scientist
Jon Slaughter
2008-10-28 14:15:20 UTC
Permalink
Post by Phil Carmody
Post by Rob Nicholson
Not sure if this is a good place to post, but we're trying to reverse
engineer an Oracle database which has two fields for date & time. They don't
seem to be encoded using the standard Oracle date/time fields so we suspect
the developer has used some bespoke encoding system.
So I thought it would be a good challenge for somebody mathematically
minded.
17th October 2008 encoded as 131598865
Hexadecimal: 0x07D80A11
07D8 = 2008
0A = 10
11 = 17
Post by Rob Nicholson
13:54:49 encoded as 221655296
Hexadecimal: 0x0D363100
0D = 13
36 = 54
31 = 49
Phil
Which means it's simply byte byte word format.

i.e., day + month << 8 + year << 16

decoding is in reverse:

day = date & 0xFF;
month = date >> 8 & 0xFF
year = date >> 16
Phil Carmody
2008-10-28 15:20:13 UTC
Permalink
Post by Jon Slaughter
Post by Phil Carmody
Post by Rob Nicholson
Not sure if this is a good place to post, but we're trying to reverse
engineer an Oracle database which has two fields for date & time. They don't
seem to be encoded using the standard Oracle date/time fields so we suspect
the developer has used some bespoke encoding system.
So I thought it would be a good challenge for somebody mathematically
minded.
17th October 2008 encoded as 131598865
Hexadecimal: 0x07D80A11
07D8 = 2008
0A = 10
11 = 17
Post by Rob Nicholson
13:54:49 encoded as 221655296
Hexadecimal: 0x0D363100
0D = 13
36 = 54
31 = 49
Which means it's simply byte byte word format.
i.e., day + month << 8 + year << 16
Not in C, it's not. + has higher precedence than <<.

Phil
--
Christianity has such a contemptible opinion of human nature that it does
not believe a man can tell the truth unless frightened by a belief in God.
No lower opinion of the human race has ever been expressed.
-- Robert Green Ingersoll (1833-1899), American politician and scientist
Rob Nicholson
2008-10-28 16:35:40 UTC
Permalink
Post by Phil Carmody
Post by Rob Nicholson
17th October 2008 encoded as 131598865
Hexadecimal: 0x07D80A11
07D8 = 2008
0A = 10
11 = 17
Ah! Thanks - can I buy you a virtual pint via PayPal?

Cheers, Rob.
Rob Nicholson
2008-10-28 16:45:00 UTC
Permalink
Post by Rob Nicholson
Ah! Thanks - can I buy you a virtual pint via PayPal?
Email ***@googlemail.com - I'm serious!

Cheers, Rob.
William Elliot
2008-10-29 06:43:23 UTC
Permalink
Post by Phil Carmody
Post by Rob Nicholson
17th October 2008 encoded as 131598865
Hexadecimal: 0x07D80A11
07D8 = 2008
0A = 10
11 = 17
There's a connection between 131598865 and 0x07D80A11 ?
Post by Phil Carmody
Post by Rob Nicholson
13:54:49 encoded as 221655296
Hexadecimal: 0x0D363100
0D = 13
36 = 54
31 = 49
Phil
--
Christianity has such a contemptible opinion of human nature that it does
not believe a man can tell the truth unless frightened by a belief in God.
No lower opinion of the human race has ever been expressed.
-- Robert Green Ingersoll (1833-1899), American politician and scientist
Phil Carmody
2008-10-29 09:27:00 UTC
Permalink
Post by William Elliot
Post by Phil Carmody
Post by Rob Nicholson
17th October 2008 encoded as 131598865
Hexadecimal: 0x07D80A11
07D8 = 2008
0A = 10
11 = 17
There's a connection between 131598865 and 0x07D80A11 ?
What do you get when you convert 131598865 to hexadecimal?

Sheesh.

Phil
--
Christianity has such a contemptible opinion of human nature that it does
not believe a man can tell the truth unless frightened by a belief in God.
No lower opinion of the human race has ever been expressed.
-- Robert Green Ingersoll (1833-1899), American politician and scientist
Loading...