Calculate the birthdate of a 18 year old person

From SMTX Wiki
Revision as of 11:54, 2 April 2025 by Smtxwiki (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Below is an example code to calculate the birthdate of a person that turns 18 today

format('{0:yyyyMMdd}', DateAdd(ToDate('#REPLACE-FORMFIELD-FormName||TodayDateField||#'), -18, 'Y'))

Alternatively you can also use the Now function:

format('{0:yyyyMMdd}', DateAdd(Now(), -18, 'Y'))