dbTalk Databases Forums  

Decoding a date & time format

comp.databases.oracle comp.databases.oracle


Discuss Decoding a date & time format in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rob Nicholson
 
Posts: n/a

Default Decoding a date & time format - 10-28-2008 , 06:00 AM






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.



Reply With Quote
  #2  
Old   
Phil Carmody
 
Posts: n/a

Default Re: Decoding a date & time format - 10-28-2008 , 07:51 AM






"Rob Nicholson" <rob.nicholson (AT) nospan (DOT) com> writes:
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


Reply With Quote
  #3  
Old   
Phil Carmody
 
Posts: n/a

Default Re: Decoding a date & time format - 10-28-2008 , 07:51 AM



"Rob Nicholson" <rob.nicholson (AT) nospan (DOT) com> writes:
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


Reply With Quote
  #4  
Old   
Phil Carmody
 
Posts: n/a

Default Re: Decoding a date & time format - 10-28-2008 , 07:51 AM



"Rob Nicholson" <rob.nicholson (AT) nospan (DOT) com> writes:
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


Reply With Quote
  #5  
Old   
Phil Carmody
 
Posts: n/a

Default Re: Decoding a date & time format - 10-28-2008 , 07:51 AM



"Rob Nicholson" <rob.nicholson (AT) nospan (DOT) com> writes:
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


Reply With Quote
  #6  
Old   
Jon Slaughter
 
Posts: n/a

Default Re: Decoding a date & time format - 10-28-2008 , 08:15 AM




"Phil Carmody" <thefatphil_demunged (AT) yahoo (DOT) co.uk> wrote

Quote:
"Rob Nicholson" <rob.nicholson (AT) nospan (DOT) com> writes:
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

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





Reply With Quote
  #7  
Old   
Jon Slaughter
 
Posts: n/a

Default Re: Decoding a date & time format - 10-28-2008 , 08:15 AM




"Phil Carmody" <thefatphil_demunged (AT) yahoo (DOT) co.uk> wrote

Quote:
"Rob Nicholson" <rob.nicholson (AT) nospan (DOT) com> writes:
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

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





Reply With Quote
  #8  
Old   
Jon Slaughter
 
Posts: n/a

Default Re: Decoding a date & time format - 10-28-2008 , 08:15 AM




"Phil Carmody" <thefatphil_demunged (AT) yahoo (DOT) co.uk> wrote

Quote:
"Rob Nicholson" <rob.nicholson (AT) nospan (DOT) com> writes:
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

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





Reply With Quote
  #9  
Old   
Jon Slaughter
 
Posts: n/a

Default Re: Decoding a date & time format - 10-28-2008 , 08:15 AM




"Phil Carmody" <thefatphil_demunged (AT) yahoo (DOT) co.uk> wrote

Quote:
"Rob Nicholson" <rob.nicholson (AT) nospan (DOT) com> writes:
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

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





Reply With Quote
  #10  
Old   
Phil Carmody
 
Posts: n/a

Default Re: Decoding a date & time format - 10-28-2008 , 09:20 AM



"Jon Slaughter" <Jon_Slaughter (AT) Hotmail (DOT) com> writes:
Quote:
"Phil Carmody" <thefatphil_demunged (AT) yahoo (DOT) co.uk> wrote in message
news:87abcoesl0.fsf (AT) nonospaz (DOT) fatphil.org...
"Rob Nicholson" <rob.nicholson (AT) nospan (DOT) com> writes:
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

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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.