Puoi usare questa classe che avevo scritto un po' di tempo fa. È scritta in VB.NET, ma fai presto a convertirla in C#:
.codice:Public Class DateTimeEdit <Runtime.InteropServices.DllImport("kernel32.dll")> _ Private Shared Function SetSystemTime(ByRef SystemTime As APISystemTime) As Boolean End Function <DebuggerStepThrough()> _ Public Shared Sub SetSystemDateTime(ByVal NewDate As Date) If SetSystemTime(New APISystemTime(NewDate)) = False Then Throw New System.ComponentModel.Win32Exception() End Sub Private Structure APISystemTime Dim wYear As UInt16 Dim wMonth As UInt16 Dim wDayOfWeek As UInt16 Dim wDay As UInt16 Dim wHour As UInt16 Dim wMinute As UInt16 Dim wSecond As UInt16 Dim wMilliseconds As UInt16 Public Sub New(ByVal Value As Date) Value = Value.ToUniversalTime() wYear = System.Convert.ToUInt16(Value.Year) wMonth = System.Convert.ToUInt16(Value.Month) wDayOfWeek = System.Convert.ToUInt16(Value.DayOfWeek) wDay = System.Convert.ToUInt16(Value.Day) wHour = System.Convert.ToUInt16(Value.Hour) wMinute = System.Convert.ToUInt16(Value.Minute) wSecond = System.Convert.ToUInt16(Value.Second) wMilliseconds = System.Convert.ToUInt16(Value.Millisecond) End Sub End Structure End Class