titbits from the world less travelled

comparing two systemtime variables using filetime in vc++

lets take a look at how to compare two systemtime variables but using Filetime to do so. We make use of the utility method CompareFiletime to do this.

1) store the systemtime in a variable
2) convert it into filetime. Use this method
SystemTimeToFileTime(&systemtime1, &filetime1)

SystemTimeToFileTime(&systemtime2, &filetime2)
3) Compare the filetimes using the method
CompareFileTime(&filetime1, &filetime2) > 0

4) finally convert the filetime to systemtime using the method
FileTimeToSystemTime(..)

posted by admin in c++, msdn, windows and have No Comments

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment