• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

Conversion of data

I have a program, that for data requirements has converted the AGE field into a 10 digit number?? I am sure it is just converted via HEX/Binary etc or something, can you help.

AGE = 1496593712

For your reference it is the conversion used for Dicom images.

Thanx
0
bolox
Asked:
bolox
1 Solution
 
cookreCommented:
One common way of saveing elapsed time is to convert it to seconds. That value interpreted as seconds yields about 47 1/2 years
0
 
Arthur_WoodCommented:
what are the data requirements that REQUIRE you to convert AGE into a 10 digit number?

What is AGE telling you?

AW
0
 
KurtVonCommented:
DICOM uses an AS field for ages, that is an Age String.  It consists of exactly four characters which are the three digit numeric representation of the age followed by a character representing the "units":

010Y = 10 years
305D = 305 days
004W = 4 weeks
007M = 7 months

It just so happens this "number" is 4 bytes of data: 59343530 in hex.  That corresponds to the four characters Y450 which is a date string backwards

054Y = 45 years old.

Hope this helps.

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
KurtVonCommented:
Oops, that's 54 years old.
0
 
boloxAuthor Commented:
KurtVon, How did you get to the result 59343530???? Fair enough i can convert this binary number to Y450, but where did the 59343530 come from??

B
0
 
KurtVonCommented:
That's the hexidecimal value.  How to get it depends on what you are doing.

If you are writing a program, you just need to convert the "integer" into a character array using whatever tools are in the language.  In C I would write:

char* strAge = (char*)&nAge;

In this case  I just typed it into Windows calulator in Advanced mode and hit the "hex" button.  I always do something like that when I suspect that a decimal value is really a string.  It  makes it a lot easier to see the individual characters.

Hope this helps.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now