Here is a routine I put together to convert SQL Server's internal DateTime representation (BINARY(8)) to a FILETIME. I know that the SQL DateTime (as in GetDate()) is not precise and will vary from the SystemTimeAsFileTime. But it should be different by milliseconds, but by seconds, right?In any case, here is my routine and I was wondering if anyone saw any flaws in it:int SQLDateTimeToFileTime(PULARGE_INTEGER t_sql, PULARGE_INTEGER t_ft){    ULONGLONG days = t_sql->LowPart;    ULONGLONG ticks = t_sql->HighPart;    days += (ULONGLONG) 109207;         // 01/01/1900 - 01/01/1601    days *= (ULONGLONG) 864000000000;   // (FT_SECONDS_PER_DAY * FT_SECOND);    ticks *= (ULONGLONG) 33333333333;   // MS per tick (3.33...) * 10000);    ticks /= (ULONGLONG) 1000000;       // to avoid floating point operation    days += ticks;    t_ft->QuadPart = days;    return(0);}
DateTime internal representation to FILETIME
c++;c;datetime;sql server