Hey @sucooon!
To count from a date into the future, you should use $(countup)
instead of $(countdown)
.
As explained in the documentation:
• countdown: use the variable to create commands that display the time left until a specified date.
• countup: use the variable to create commands that display the time since a specified date.
Now that this issue is out of the way, let’s see how to do what you’re looking for:
$(eval y=`$(countup 09 26 1979 00:00:00 AM Europe/Berlin)`.split(` `);y.length=2;y.join(` `);)
With this you’ll get XX years
as a result.
If you wish to only have XX
, replace y.length=2;y.join(` `);
with y[0];
, like this:
$(eval y=`$(countup 09 26 1979 00:00:00 AM Europe/Berlin)`.split(` `);y[0];)