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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top