Field Validation: 18 Years or Older I am using the Field Validation module to validate a date field that will contain a user's birthday. I want to make sure the person is 18 years of age or older. Here are the settings I was thinking of using in my validation rule. Are these correct?

Column: value

Minimum Date: now - 18 year
Depending on your requirements, Field Validation can be a good approach.  It's simple to set up, but one potential issue is that if this field is something that the user can edit, they can easily modify their birthday if the form submission is rejected.

Often this is OK, but for my site I needed to actually block users who were under 18, so I did the following.  I have a required date field, birthday, on the user registration form.

Then, I added a computed field, age, to calculate the age based on the value of the date field, birthday.  For sample PHP, you can see this Stack Overflow answer.  This is a way that you can take into account leap years, etc.

Then, I added a rule:

Event After saving a new user account

Condition Data to compare: Age less than 18.

Actions Block user

The advantage of doing it this way is that if a user registers with a birthday under 18, their e-mail address will be blocked from registering again.  Of course, this may or may not be necessary for your case, but I'm just putting it out there because other sites may have such a requirement.