UpdateLocalTime Function  
 
BOOL WINAPI UpdateLocalTime(
  DWORD dwNetworkTime  
);

The UpdateLocalTime function sets the local system clock to the specified date and time.

Parameters

dwNetworkTime
The date and time the system clock should be set to, represented as the number of seconds since midnight, 1 January 1900.

Return Value

If the function is able to update the local time, it returns a non-zero value. If the specified time is invalid, or the user does not have the access rights to change the system clock, the function returns zero.

Remarks

The network time value can represent a date and time up to the year 2036.

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use cstimav7.lib.

See Also

ConvertNetworkTime, GetNetworkTime, QueryNetworkTime, TimeInitialize