How to synchronize date and time from Server date and time? VB.Net Tutorial

Wow… question is very familiar in the web search. Most of the VB.Net programmer if beginner asks this question if they setting up client application that they want to pick up time from the server for exact date and time.


In order to synchronize the date and date from the server, you need to get the time and date of the server for the first time. I’ll give you the link on how to do that. [LINK]

Once you pick up the server time and date, after that you are going to sync the date and time in your client computer.  At the Public Sub updatedate() you are going to add a piece of code, the code is this today= dRemoteDate, that is very simple.

On the other hand you may encounter this error once you sync the time and date. It cause by the security policy.

Error: Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission, contact your system administrator, or use the Microsoft .NET Framework Configuration tool.

If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Insufficient security permissions to set the system date.

But this is a very simple problem, all you have to do is to set up your program compatibility, simply check “Run as Administrator”, or right click the program and “Run as Administrator”. That’s it. Have a happy programming day.

Post a Comment

Your comment/s are highly appreciated..! Thanks for dropping here..!