How to set the system date/time?

  • Thread starter Thread starter OtherOne
  • Start date Start date
O

OtherOne

My system clock tends to lose (or sometimes gain) time and I am running some
time critical processes so I need to keep the clock synchronized. I wrote
the code to get the time from a time server but I can't find how to set the
system time (DateTime.Now being read only).

Any suggestions?

Thanks,
 
Found one solution, calling the SetSystemTime API function.

Is there no .NET method of doing this?
 
not that i'm aware of, i've used the SetLocalTime api call before, and, in
the vague interests of portability, i'd doubt this would become a framework
call...

r.
 
Back
Top