FILETIME to Unix Time (__time64_t or time_t)



Here is the code to convert FILETIME to Unix Time (__time64_t). You can also use time_t instead of __time64_t.

__time64_t FileTimeToUnixTime(FILETIME & ft)
{
	ULARGE_INTEGER ull;
 
	ull.LowPart = ft.dwLowDateTime;
	ull.HighPart = ft.dwHighDateTime;
 
	return ull.QuadPart / 10000000ULL - 11644473600ULL;
}

Leave a Reply

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

*

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">