Skip to content

Latest commit

 

History

History
108 lines (76 loc) · 4.86 KB

nf-winternl-rtltimetosecondssince1970.md

File metadata and controls

108 lines (76 loc) · 4.86 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winternl.RtlTimeToSecondsSince1970
RtlTimeToSecondsSince1970 function (winternl.h)
Converts the specified 64-bit system time to the number of seconds since the beginning of January 1, 1970.
RtlTimeToSecondsSince1970
RtlTimeToSecondsSince1970 function
base.rtltimetosecondssince1970
winternl/RtlTimeToSecondsSince1970
base\rtltimetosecondssince1970.htm
winprog
cb2e041a-cbbb-4572-85da-b282fa692261
12/05/2018
RtlTimeToSecondsSince1970, RtlTimeToSecondsSince1970 function, base.rtltimetosecondssince1970, winternl/RtlTimeToSecondsSince1970
winternl.h
Windows
ntdll.lib
ntdll.dll
Windows
19H1
RtlTimeToSecondsSince1970
winternl/RtlTimeToSecondsSince1970
c++
APIRef
kbSyntax
DllExport
Ntdll.dll
RtlTimeToSecondsSince1970

RtlTimeToSecondsSince1970 function

-description

[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.

-parameters

-param 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.

-param ElapsedSeconds [out]

A pointer to a variable that receives the number of seconds.

-returns

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.

-remarks

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:

  1. Call SystemTimeToFileTime to copy the system time to a FILETIME structure. Call GetSystemTime to get the current system time to pass to SystemTimeToFileTime.
  2. Copy the contents of the FILETIME structure to a ULARGE_INTEGER structure.
  3. Initialize a SYSTEMTIME structure with the date and time of the first second of January 1, 1970.
  4. Call SystemTimeToFileTime, passing the SYSTEMTIME structure initialized in Step 3 to the call.
  5. Copy the contents of the FILETIME structure returned by SystemTimeToFileTime in Step 4 to a second ULARGE_INTEGER. The copied value should be less than or equal to the value copied in Step 2.
  6. Subtract the 64-bit value in the ULARGE_INTEGER structure initialized in Step 5 (January 1, 1970) from the 64-bit value of the ULARGE_INTEGER structure initialized in Step 2 (the current system time). This produces a value in 100-nanosecond intervals since January 1, 1970. To convert this value to seconds, divide by 10,000,000.

-see-also

FILETIME

SYSTEMTIME

SystemTimeToFileTime

Time Functions

ULARGE_INTEGER