Getting date and time from two 32 bit numbers 
Author Message
 Getting date and time from two 32 bit numbers

Hi,
  I have a problem of handling 64 bit quantity. Can anyone provide me
any inputs (or solution)??? I explain the problem below:

    I have two 32-bit numbers(Stored 64 bit quantity as two 32 bit
quantities.- one being high 32 bit and the other low 32 bit).     This
whole 64 bit number gives number of milliseconds past 1st     January
1600. I have to arrive at date and time.(in other words, I     have to
convert this number of milliseconds to 'a' years, 'b'     months, 'c'
days, 'd' hours, 'e' minutes, 'f' seconds and
    'g' milliseconds.).  This involves division of two 32 bit
number     by a 32 bit number and storing the result in a 32 bit
number. Hope     problem is clear. Can anyone help me???

thanks,
Kishore.

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Tue, 15 Oct 2002 03:00:00 GMT  
 Getting date and time from two 32 bit numbers

Quote:

> Hi,
>   I have a problem of handling 64 bit quantity. Can anyone provide me
> any inputs (or solution)??? I explain the problem below:

>     I have two 32-bit numbers(Stored 64 bit quantity as two 32 bit
> quantities.- one being high 32 bit and the other low 32 bit).     This
> whole 64 bit number gives number of milliseconds past 1st     January
> 1600. I have to arrive at date and time.(in other words, I     have to
> convert this number of milliseconds to 'a' years, 'b'     months, 'c'
> days, 'd' hours, 'e' minutes, 'f' seconds and
>     'g' milliseconds.).  This involves division of two 32 bit
> number     by a 32 bit number and storing the result in a 32 bit
> number. Hope     problem is clear. Can anyone help me???

> thanks,
> Kishore.

Your best bet is to get a large number library and just copy the num
into that, otherwise you could easily code some routines yourself.
Naively you could repeatedly subtract 31,536,000,000 until you get a
result <= it, that is the number of years, then just subtract 86,400,000
until you get a no.....

Subtraction is rather simple, if (a, b) is your input (high, low) and
you are subtracting (c, d) then you get

b1 -= d;
a -= (c + (b1 > b));
b = b1;

Tom
--
Want your academic website listed on a free websearch engine?  Then
please check out http://www.*-*-*.com/ , it's entirely
free
and there are no adverti{*filter*}ts.



Wed, 16 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting date and time from two 32 bit numbers!!

2. top 32 bits of 64-bit product of two 32-bit integers

3. how to write and read two 16 bit values into one 32 bit

4. Get Nth bit value from a 32-bit number

5. Trouble representing signed 16 bit number as two signed 8 bit numbers

6. Getting Number of Months and Days between two dates

7. 32-bit VC 2.2 DLLs with 32-bit VB4

8. Linking 32 bit VC++4.2 DLLs with VB4.0 32 bit

9. 32 bit Icons and C# VS.net (24 bit + 8 bit alpha)

10. looking for a 32-bit uniform random number generator

11. 32 bit floating point numbers

12. Multi-bit (>32 bits) number operations.

 

 
Powered by phpBB® Forum Software