More .NET components

System clock

Setting local system time #

SystemClock class makes it possible to set the local computer clock using the SetClock method:

CSharp

// change the current time to the end of Unix epoch
Rebex.SystemClock.SetClock(new DateTime(2038, 1, 19));

VisualBasic

' change the current time to the end of Unix epoch
Rebex.SystemClock.SetClock(New DateTime(2038, 1, 19))

Note: To update the system time, administrator privileges are needed. Check out the TimeWinFormClient sample code to see how to elevate the application to obtain them.

SystemClock class supports Windows, Windows CE and Linux operating systems.