Calculate age based of a date field

I have a date field that I am using as dateOfBirth. How can I calculate the age of that person on a certain date based on the date of birth?

You can use a fomula field with something like

date_diff('years', dob, now()).to_i