Making a registration form that requires user to be over 13 (COPPA compliant form)

Hi,
In the U.S.A for anyone to have access to any site that allows you
access to a chatroom, forum, anything that sends text over the
internet you have to be over 13 unless everything everyone can say is
from a pre-select menu.

Well, I don’t want to limit people’s freedom of speech but I do want
to be compliant with the COPPA, so I’m trying to make a form where you
select the day you were born, the month you were born, the year you
were born and then if the combination equals that the person is under
13 they aren’t allowed to sign up. I’m trying to remember the formula
that’s used to figure out someones age by the day, I think it had
something to do with how many milliseconds you’ve been alive…
anyways if anyone knows the answer to my question and if you are
generous enough to post any examples I would be very grateful.
I will do my best to reply to any questions but I will not have much
access to the internet as usual for the rest of the week.

thanks for your replies in advance.

Assuming that date contains the borning date:

if date < Date.today - 13.years

Ok

else

No

end

Wow, that is so much easier than the insane formula I was trying to
remember when I programmed in the evil language of PHP. Thank you so
much!!

On Apr 6, 11:27 pm, Gianluca T.