NtQuerySystemTime function (winternl.h)

[NtQuerySystemTime may be altered or unavailable in future versions of Windows. Applications should use the GetSystemTimeAsFileTime function.]

Retrieves the current system time.


__kernel_entry NTSTATUS NtQuerySystemTime(
  [out] PLARGE_INTEGER SystemTime


[out] SystemTime

A pointer to a LARGE_INTEGER structure that receives the system time. This is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).

Return value

If the function succeeds, it returns STATUS_SUCCESS. If it fails, it will return the appropriate status code, which will typically be STATUS_ACCESS_VIOLATION.


This function has no associated import library. You must use the LoadLibrary and GetProcAddress functions to dynamically link to Ntdll.dll.


Requirement Value
Target Platform Windows
Header winternl.h
Library ntdll.lib
DLL ntdll.dll

See also


Time Functions