|
-
March 26th, 2003, 06:04 AM
#1
time difference
Does anybody of you know (where to find) a good logarythm to calculate the difference between to SYSTEMTIMEs in Hours
-
March 26th, 2003, 11:28 AM
#2
This is my second posting of this as the server didn't accept the first (destroying it in the process ) - apologies if this is duplicated...
Use SystemTimeToFileTime to convert the structure to a FILETIME variable.
Then, copy the contents of the new FILETIME variable to a ULARGE_INTEGER variable.
Use the ULARGE_INTEGER's .QuadPart member to perform calculations on the time (such as subtracting one time from another)
The values being handled by the ULARGE_INTEGER will be the same units as used by the FILETIME data structure, which is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601.
Once you have finished your addition or subtraction, you can divide out the result to give you hours or any other value you need as long as it is a multiple of 100 nanoseconds.
(Dividing by 36000000000 sounds like a good place to start )
Hope this helps,
- Nigel
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|