DateTime calculation and formatting

Wei Wang asked on April 10, 2020 16:36

Hi, Question again on datetime calculation and formatting. So I need to calculate two datetime fields using macro so I did {% expdate - CurrentDateTime #%} to get how many days until the password would expire. I got the following: YOUR PASSWORD WILL EXPIRE IN 3.13:29:27.6329417 DAYS

I need to format it to 3 days, not that long value. How can i do that? Tried something but nothing works as I expected.

thanks, Wei Wang

Correct Answer

Brenden Kehren answered on April 10, 2020 17:17

Do something like:

ToTimeSpan(expDate - CurrentDateTime).Days

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.