TA_HAS_NOT_EXPIRED not working in Delphi...Solved

Hello. I added in the custom license field
time limit (1 hour) called "1hTest" I created a new key, then I activate the application and after restarting the application there is a problem with checking how much time is left until the application is deactivated. The application immediately informs that the subscription has expired and it is not yet an hour since creating a key.
Here is an example of Delphi code:

if isGenuine then
  begin
      // read in a custom license field named "update_expires"
      featureValue := ta.GetFeatureValue('1hTest', '');
      // if the date has passed then kill the app immediately
      if (featureValue = '') Or (not ta.IsDateValid(featureValue, TA_HAS_NOT_EXPIRED)) then begin
         ShowMessage('Your subscription has expired. Buy a renewal.');
         // Exit the app, and exit the function immediately
         //   Application.Terminate;
       //  exit;
      end
      else
      ShowMessage('1h Activation');
  end;

If you only check the name of a custom license field:

if (featureValue = '') then begin

ShowMessage('Your subscription has expired. Buy a renewal.');
         // Exit the app, and exit the function immediately
         //   Application.Terminate;
       //  exit;
      end
      else
      ShowMessage('1h Activation');

Then everything works as it should.

What am I doing wrong?
Thanks greetings

Answer

Did you read the docs in TurboActivate.h? Namely, what time zone is being used (it‘s UTC).

Welcome back...:) Everything is correct. We use UTC time. At the moment in my country (Poland) it is 09:28 and the UTC time is 08:28 ... I create an activation period in a custom field of the license for e.g. one hour. So when creating the key in the time field (relative time) I should see UTC + 1, but it is not. In the automatically generated time field after creating the key there is ... 04:28 which is UTC time - 4 hours. How should I understand that? Best wishes.

Answer

Use UTC date/times in the custom licensing fields. That’s what IsDateValid interprets the date/times as, so putting anything else in there will be interpreted in a way you don’t intend.

covered in the docs. See TurboActivat.h

Thanks for the answer. I will test. greetings