Let me try and explain this one !!!!

My application needs to validate the "age" of a competitor to be eligible to enter a race class [category i.e. OR1].

The age to enter the OR1 class is 16. However this is 16 years of age on the 1st of January. If the competitor is already/still 16 on the on the 1st of January, then he can enter the race.

BUT !!!

If he turned 17 BEFORE the 1st of January then he is not allowed to enter the race and if he turned 17 any other day of the year after the 1st of January, then he can still enter.

MY question;

How do I bring the 1st of January into the equation when his age is calculated and he enters TODAY [any date after the 1st of January].

Confused, yip I am.

16 years of age on the 1st of January is the marker/threshold. If he turns 17 on the 2nd of January then he can still enter the OR1 class as his entry age is calculated as on the 1st of January. Damn this is confusing.

## Bookmarks