Time Synchronizations in Windows

Time Synchronizations in Windows

Recently one of my components that I was developing was DateTime driven and hence I had to change system time to see its behavior for different periods. The problem is that, you need to be very careful with changed system times, particularly when you checkin the file to SourceSafe, SendMails since a wrong time means total chaos for these systems.

For these, I choose to have a simple batch file to syncrhonize time with the SourceSafe database itself. It just goes like this:

net time \\mysourcesafeserver  /set /y

net time \\mysourcesafeserver queries the time on the server
/set sets the time on the localhost to the time on the server (This will wait for a prompt of confirmation from the user, which can be avoided by appending a /y to the command)

But I have a question. Perhaps if some sysadmin drops by this post, he can put a comment and solve this so that it will be useful to other readers.

  1. What happens if the logged on user does not have privileges to set time? He is getting Access is denied.
  2. With Windows XP (Time Synchryonization) itself, will the problem in (1) get solved?
  3. To query net time \\mysourcesafeserver one must be logged on to \\mysourcesafeserver previously either my remembered network connection or previous manual logon? Is there any other solution for this?

But I hope the above batch file would be useful to many developers playing with and developing DateTime driven components.

/* Migrated from Daffodilnet Express — posted on October 15, 2004 */

One thought on “Time Synchronizations in Windows”

  1. When you are in a not good position and have got no money to go out from that, you would require to receive the home loans. Because that would help you definitely. I get auto loan every time I need and feel myself great just because of it.

Leave a Reply

Your email address will not be published. Required fields are marked *