Verified Trial, show days remaining

Hi,

in a verified trial, I can check my custom "trial_expires" field versus the IsDateValid function which works pretty well.However, in an unverified trial I can also access the TrialDaysRemaining function.Can you suggest an easy way to get the remaining days of a verified trial? (I'm sure you'll have already a function that does the string parsing and internet time retrieval pretty well).

Thanks,ekneos

The easiest way to see if a trial has expired it to use the IsDateValid() function which checks if the passed in UTC date/time string has expired or not.

Of course you have to use GetFeatureValue() to actually get the string value.

Thank you, yes.

But would you have a snippet of code from your library at hand to calculate the number of remaining trial days?

In the unverified trial, there is such a function, but it cannot be used for verified trials.

There currently isn't a function. When we build verified trial into UseTrial(), then you'll just be able to use TrialDaysRemaining(). Build-in verified trials are coming with TurboActivate 4.0, which is being finalized.

In the meantime, though, you'll have to get the custom license fields from the regular activation using GetFeatureValue(), and then parse that string to get the date in a form that you can work with in whatever programming language you're using. Some languages (like C# / VB.NET) offer easy tools to help parse and use date/times in string form. But it really depends on your language.