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(..)

Leave a Reply

Your email address will not be published. Required fields are marked *