I'm at a lot as what to search for but heres my problem.
The current application I am writing depends heavily on specified dates. The program will compensate for any computations it may have missed since it was last ran. So the program doesn't have to run continuously.
Each time the main loop executes I store a LastTick DateTime into a database. So if the System Date is set back I can catch this. But is there a way to tell if the system clock was purposely pushed forward w/out quering a web service
The problem arises if a user pushes his clock forward by accident or on purpose and runs the application (or if the application is already running). The app will think that it just hasn't ran in X days since lasttick and compute and store various transactions.
So whats the best solution for this * Would it be maybe prompting the user if we havn't ran in X days if he want to continue * Just offer database rollback to certain dates * Attempt to monitor system time
I am guessing the most efficient way is to offer a rollback if the user notices that he accidently ran the app after he push the clock forward
There's really not much you can do about something like this. If you're using a remote database (say SQL Server) then you could use the date/time information from that server instead. Alternatively, as has been suggested you'll have to use some other server for your date/time information and ignore the client computer's date/time. Otherewise, you'll just have accept what the local user has done with their local settings.
Posted: Visual C# General, Monitoring Suspicious System Time Change