Skip to content
Advertisement

System Time change detection on linux

I was reading about the licensing of software and one question that came to my mind is that “how software detect the change in system time and block themselves if someone changes system time?”. Since there is no other reference available(provided we don’t have internet connection, otherwise we can use time servers as reference), how such software manages to do it? Are there standard algorithms or any standard libraries(C/C++) available for implementing the same. Please suggest.

Advertisement

Answer

You could always set the timestamp on a file to the current system time every time your application starts.

Check the time first before setting it – if it’s in the future, then the clock has gone backwards since you last set it.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement