Is there any other time service than system time t

2019-06-14 11:58发布

问题:

I am developing a desktop app and it have an trial period after which application will get expire. Currently I am using system time. Since user can easily change it, I thought its not a good way to follow.

Is there any other time service that is available which I can make use of? I heard something like system clock count or something like that which cannot be easily changed by user. Can anyone put light on this?

回答1:

If you don't want to trust the system clock, you are going to have problems.

Probably your best bet is an NTP or SNTP connection to establish the current time from authoritative time servers outside the organization - but you may easily be blocked by firewalls, etc.

However, that is really overkill; people don't futz with the system clock for long - it is far too much of a nuisance.



回答2:

A DIY solution using SNTP SNTP time class