Answer the question
In order to leave comments, you need to log in
How to synchronize date and time?
How to sync date and time from computer?
Answer the question
In order to leave comments, you need to log in
Where to sync? Where? And what about units? Try to formulate the question properly.
If the windows time service is running, then this:
Process foo = new Process();
foo.StartInfo.FileName = "w32tm.exe";
foo.StartInfo.Arguments = "/resync";
foo.Start();
I can advise you to do this:
- do all manipulations with dates on the server and client only in UTC and, if possible, use milliseconds. https://currentmillis.com/ (int32 does not roll, float is needed)
- store datetimeoffset in the database (this is a date with an offset from UTC, i.e. a time zone).
Time is the same all over the world, it is one straight line, it is the same for everyone.
And if you get it in UTC, then you will work in the same coordinate system, and the client, if he needs to add his current time zone himself, will receive a display of a single time in "local form".
It is easier to perceive it as displaying the number "2" in binary, hexadecimal and any other form, the value is still "2".
Fundamental problems that you all know about now -... - Jon skeet
50 minutes.
If this is not a server application then here is the
timeApi response
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question