To add a time-limited trial, issue a license that carries an expiry date and check it every time the app launches. The important detail is where the expiry lives: store it on your server, not only on the users machine, so the countdown cannot be reset by editing a file or changing the system clock. When the date passes, the license simply stops validating, and your app locks or drops to a limited mode.
What a good trial does
A trial has two jobs that pull in opposite directions. It has to give the user enough access, for enough time, to see real value — otherwise they never convert. And it has to end reliably, so people cannot use your software for free forever. Getting both right is mostly about where you keep the clock.
The naive approach and why it fails
The tempting version is to write the install date to a local file or registry key and compare it against the system clock. It works until the first user realizes they can delete the file, or set their computer date back to last week, and the trial resets. Local-only trials are trivially defeated, and the people who defeat them were never going to be blocked by a honor-system timer.
Server-enforced expiry
The reliable version keeps the expiry on your server. When the app validates the trial license, the server compares the expiry against its own clock — a clock the user cannot touch. Changing the local date does nothing, because the decision is not made locally. This is the same server-side validation you would use for a paid license; a trial is just a license with an end date. If you have read our guide on validating a license key in Python, you already have the mechanism.
Start the clock on first use
Deciding when the countdown begins matters more than it sounds. If it starts at download, a user who gets busy for a week loses half their trial before they even open the app, and they convert worse. Starting on first use is usually better: the server records the activation time the first time the license validates, and computes the expiry from there. Everyone gets their full trial, beginning when they actually start evaluating.
Converting a trial to a paid license
Keep the trial and paid versions as the same build, gated by the license. Then converting a customer is effortless: your server marks the license as paid and clears the expiry, and the next validation unlocks the full version. No reinstall, no lost settings, no friction at the exact moment someone has decided to pay you. Forcing a fresh download to upgrade is a self-inflicted wound.
Preventing trial abuse
The main abuse is one person starting trial after trial. Binding each trial to a machine fingerprint and to an email limits this: the same device or account cannot start an endless series of fresh trials. You will not stop someone with a fleet of virtual machines, but you will stop the casual repeat-trialer, who is the common case. As with all licensing, the goal is to make abuse more effort than simply paying.
Want trials that are server-enforced, start on first use, and convert to paid with a single switch? Create a free account — trial handling is built in.
Frequently asked questions
How do I add a free trial to my software?
Issue a license with an expiry date and check it on every launch. Store the expiry on your server, not only on the users machine, so the app confirms the remaining time from a source the user cannot edit. When the date passes, the license stops validating and the app locks or reverts to a limited mode.
How do I stop users resetting the trial by changing the date?
Do not trust the local system clock. Enforce expiry on your server, which has its own reliable time. When the app validates the license, the server compares against its own clock, so setting the computer date back does nothing.
Should the trial clock start at download or first launch?
First launch is usually better. Starting the countdown when the user actually runs the software means people who download and forget still get their full trial, which improves conversion. You store the activation time on first validation and compute expiry from there.
How long should a software trial last?
It depends on how long it takes a user to see value. Fourteen days is a common default for tools; complex products often use thirty. Long enough to evaluate properly, short enough to create urgency.
Can I turn a trial into a paid license without reinstalling?
Yes. If the trial and paid versions are the same build gated by a license, upgrading is just a matter of the server marking the license as paid and removing the expiry. The user keeps their install and settings, and the next validation unlocks the full version.