I have an entry with a dateOfBirth Date/Time Field.

Is it possible to calculate the current age from that field?

I can't find a craft/twig function/filter to calculate the difference between 2 dates.

1 Answer 1


Craft's Date/Time field extends PHP's DateTime class so (since 5.3.0) you can use the Diff method like so:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.