The easiest way is to use the contiguous Julian date system, e.g.:
(
(lambda ( date expdate / dif )
(if
(cond
( (not (or dtoj (and (load "julian.lsp" nil) dtoj))))
( (<= (setq dif (- (fix (dtoj expdate)) date)) 0)
(alert "Program has expired.")
)
( (progn (alert (strcat "Program will expire in " (itoa dif) " day" (if (= 1 dif) "." "s."))) t))
)
(progn
(defun c:test ( )
(alert "Hello World!")
(princ)
)
)
)
)
(fix (getvar 'date))
20190131
)
Here, the Express Tools' dtoj function is only used to make it easier to specify the expiration date in the code - you can easily remove this reliance by specifying the expiration date as a Julian date directly in the code.
Note that this approach is still susceptible to the user changing the system clock - hence the suggestion to use my Internet Time function above.