#ifndef _NTRTL_H
NTSYSAPI
BOOLEAN
NTAPI
RtlTimeToSecondsSince1970(
_In_ PLARGE_INTEGER Time,
_Out_ PULONG ElapsedSeconds
);
View code on GitHub// ntifs.h
NTSYSAPI BOOLEAN RtlTimeToSecondsSince1970(
[in] PLARGE_INTEGER Time,
[out] PULONG ElapsedSeconds
);
View the official Windows Driver Kit DDI reference// winternl.h
BOOLEAN RtlTimeToSecondsSince1970(
[in] PLARGE_INTEGER Time,
[out] PULONG ElapsedSeconds
);
View the official Win32 API referenceThis function is documented in Windows Driver Kit.
The RtlTimeToSecondsSince1970 routine converts a given absolute system time value to the elapsed time, in seconds, since the beginning of 1970.
Time [in]Pointer to a variable that specifies the system time value to be converted. The approximate valid range for this variable begins at 1970 and ends around 2105.
ElapsedSeconds [out]Pointer to a caller-allocated variable that receives the corresponding number of seconds since midnight, December 31, 1969.
RtlTimeToSecondsSince1970 returns TRUE if the input Time falls within a range that it can accurately convert to ElapsedSeconds.
The basis for system time is the start of 1601. The absolute system time is a LARGE_INTEGER value, accurate to 100-nanosecond resolution, assuming an accurate hardware clock. The value processed by RtlTimeToSecondsSince1970 is truncated to one-millisecond resolution.
For more information about converting time values, see Data Conversions.
[RtlTimeToSecondsSince1970 is available for use in Windows 2000 and Windows XP. It may be unavailable or modified in subsequent releases.]
Converts the specified 64-bit system time to the number of seconds since the beginning of January 1, 1970.
Time [in]A pointer to a LARGE_INTEGER structure that specifies the system time. The valid years for this value are 1970 to 2105 inclusive.
ElapsedSeconds [out]A pointer to a variable that receives the number of seconds.
If the function succeeds, it returns TRUE. If it fails, it returns FALSE. Typically, this function will fail if the specified value of the Time parameter is not within the valid timeframe specified in the parameter description.
This function has no associated import library. You must use the LoadLibrary and GetProcAddress functions to dynamically link to Ntdll.dll.
There is no single equivalent public function. To perform this task using public functions, use the following steps: