Mohnish
Mohnish

Reputation: 71

Unchangeable Universal Time

I have developed an application in C# which uses the time of the system. My problem is that if someone changes the time of the system, it affects the application also. The application would then show data of that changed time and not the current time.

How do i avoid this? Is there any other way to get a single universal time?

Upvotes: 0

Views: 282

Answers (2)

dotnetengineer
dotnetengineer

Reputation: 1302

If time is so critical, keep anything that is dependent on the time isolated on the server. Move the actual processing to the server, and just display the result on the client.

Upvotes: 0

xanatos
xanatos

Reputation: 111870

You can use NTP to ask to an authoritative time server what time it is, for example. If you google for NTP client C# you'll find plenty of examples.

Upvotes: 3

Related Questions