Set the local system clock to the current date and time as returned by the specified time server.
This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.
The SetTime method updates the local system clock to the date and time returned by the time server. The user must have the appropriate privileges to change the system clock, otherwise an error will be returned. This typically requires the application to execute with elevated privileges.
Because Windows systems are usually configured to automatically synchronize the system clock with a time server using the Windows Time service (W32Time), most applications should not use this method. If there is a significant discrepancy between the local system time and the several different time servers, the recommended course of action is to warn the user and prompt them to check their system settings and ensure the Windows Time service is running.