Microsoft offers the following function in its support article :
// NOTE: this function is INCORRECT! void UnixTimeToFileTime(time_t t, LPFILETIME pft) { // Note that LONGLONG is a 64-bit value LONGLONG ll; ll = Int32x32To64(t, 10000000) + 116444736000000000; pft->dwLowDateTime = (DWORD)ll; pft->dwHighDateTime = ll >> 32; }
However, if the Unix time "t" refers to the dates after the year 2038, this function produces an incorrect result. How to make it work properly after the year 2038?