on-internet
← Community

Can a C++ desktop application reliably detect system clock rollback without a trusted external time source?

Stack Overflow ·

I have a C++ desktop application with a simple expiry-date license check based on the local system clock. The application is normally used with an external device/modem, but I cannot rely on that device as a time source: the tool may legitimately be used while the device is disconnected, malfunctioning, not yet initialized, or replaced by a simulator. Requiring permanent Internet access is also undesirable because the tool may need to operate offline during testing. At startup I currently do something like: bool LicenseManager::IsDateValid() { return wxDateTime::Now() <= GetExpiryDate(); } I u

Comments

Sign in or sign up to comment and upvote.

No comments yet.