Connecting Tech Pros Worldwide Help | Site Map

Decoding a date & time format

Rob Nicholson
Guest
 
Posts: n/a
#1: Oct 28 '08
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
Guest
 
Posts: n/a
#2: Oct 28 '08

re: Decoding a date & time format


"Rob Nicholson" <rob.nicholson@nospan.comwrites:
Quote:
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
Hexadecimal: 0x07D80A11
And:
07D8 = 2008
0A = 10
11 = 17
Quote:
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
Guest
 
Posts: n/a
#3: Oct 28 '08

re: Decoding a date & time format



"Phil Carmody" <thefatphil_demunged@yahoo.co.ukwrote in message
news:87abcoesl0.fsf@nonospaz.fatphil.org...
Quote:
"Rob Nicholson" <rob.nicholson@nospan.comwrites:
Quote:
>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
>
Hexadecimal: 0x07D80A11
And:
07D8 = 2008
0A = 10
11 = 17
>
Quote:
>13:54:49 encoded as 221655296
>
Hexadecimal: 0x0D363100
And:
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
Guest
 
Posts: n/a
#4: Oct 28 '08

re: Decoding a date & time format


"Jon Slaughter" <Jon_Slaughter@Hotmail.comwrites:
Quote:
"Phil Carmody" <thefatphil_demunged@yahoo.co.ukwrote in message
news:87abcoesl0.fsf@nonospaz.fatphil.org...
Quote:
>"Rob Nicholson" <rob.nicholson@nospan.comwrites:
Quote:
>>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
>>
>Hexadecimal: 0x07D80A11
>And:
>07D8 = 2008
> 0A = 10
> 11 = 17
>>
Quote:
>>13:54:49 encoded as 221655296
>>
>Hexadecimal: 0x0D363100
>And:
>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
Guest
 
Posts: n/a
#5: Oct 28 '08

re: Decoding a date & time format


>17th October 2008 encoded as 131598865
Quote:
>
Hexadecimal: 0x07D80A11
And:
07D8 = 2008
0A = 10
11 = 17
Ah! Thanks - can I buy you a virtual pint via PayPal?

Cheers, Rob.


Rob Nicholson
Guest
 
Posts: n/a
#6: Oct 28 '08

re: Decoding a date & time format


Ah! Thanks - can I buy you a virtual pint via PayPal?

Email informed.direct@googlemail.com - I'm serious!

Cheers, Rob.


William Elliot
Guest
 
Posts: n/a
#7: Oct 29 '08

re: Decoding a date & time format


On Tue, 28 Oct 2008, Phil Carmody wrote:
Quote:
"Rob Nicholson" <rob.nicholson@nospan.comwrites:
Quote:
Quote:
>17th October 2008 encoded as 131598865
>
Hexadecimal: 0x07D80A11
And:
07D8 = 2008
0A = 10
11 = 17
>
There's a connection between 131598865 and 0x07D80A11 ?


Quote:
Quote:
>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
>
Phil Carmody
Guest
 
Posts: n/a
#8: Oct 29 '08

re: Decoding a date & time format


William Elliot <marsh@rdrop.remove.comwrites:
Quote:
On Tue, 28 Oct 2008, Phil Carmody wrote:
>
Quote:
>"Rob Nicholson" <rob.nicholson@nospan.comwrites:
>
Quote:
Quote:
>>17th October 2008 encoded as 131598865
>>
>Hexadecimal: 0x07D80A11
>And:
>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
Closed Thread