GetLocalTime function (sysinfoapi.h)

Retrieves the current local date and time.

To retrieve the current date and time in Coordinated Universal Time (UTC) format, use the GetSystemTime function.

Syntax

void GetLocalTime(
  [out] LPSYSTEMTIME lpSystemTime
);

Parameters

[out] lpSystemTime

A pointer to a SYSTEMTIME structure to receive the current local date and time.

Return value

None

Remarks

To set the current local date and time, use the SetLocalTime function.

Examples

For an example, see SYSTEMTIME.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header sysinfoapi.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

GetSystemTime

Local Time

SYSTEMTIME

SetLocalTime

Time Functions