1

How can i get utc time in windows kernel mode?

I'm aware of KeQuerySystemTime (but this is 1601 based).

i found this solution.

LONGLONG FileTime_to_POSIX(FILETIME ft)
{
    // takes the last modified date
    LARGE_INTEGER date, adjust;

    date.HighPart = ft.dwHighDateTime;
    date.LowPart = ft.dwLowDateTime;

    // 100-nanoseconds = milliseconds * 10000
    adjust.QuadPart = 11644473600000 * 10000;

    // removes the diff between 1970 and 1601
    date.QuadPart -= adjust.QuadPart;

    // converts back from 100-nanoseconds to seconds
    return date.QuadPart / 10000000;
}

but this seems to be wrong, i tested it and it was round about 10 seconds wrong

user1235183
  • 3,002
  • 1
  • 27
  • 66

0 Answers0