Solved

Conversion of data

Posted on 2003-12-03
6
270 Views
Last Modified: 2010-04-17
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
Comment
Question by:bolox
6 Comments
 
LVL 22

Expert Comment

by:cookre
ID: 9868131
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
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9868619
what are the data requirements that REQUIRE you to convert AGE into a 10 digit number?

What is AGE telling you?

AW
0
 
LVL 11

Expert Comment

by:KurtVon
ID: 9869625
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 11

Expert Comment

by:KurtVon
ID: 9869637
Oops, that's 54 years old.
0
 
LVL 1

Author Comment

by:bolox
ID: 9873232
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
 
LVL 11

Accepted Solution

by:
KurtVon earned 30 total points
ID: 9874588
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
copyEvens challenge 6 63
How  do I get an older program to run in Windows 10? 20 80
White board coding practice 3 61
Birthdays 3 0
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now