By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,806 Members | 1,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,806 IT Pros & Developers. It's quick & easy.

Calculating when someone will be 16

P: 1

Please can you help if there is a javascript calculator which would tell user the DATE that another person becomes 16 years old.
We have Birth date of customer and current date to work with always but often staff not knowing how to make calculation to understand when customer become 16.

Please may you help.

Thank you.

Mar 14 '12 #1
Share this Question
Share on Google+
3 Replies

Expert Mod 10K+
P: 12,422
The javascript date object has a setFullYear function. Use that to add 16 years to the year of the birth date.
Mar 14 '12 #2

P: 1
Hello Rabbit.
I do not know how to use that information.
I have Googles setFullYear function but search give me lots of information that does not match how to show when a customer reach 16.

Please can you tell me how to imply this setFullYear function into webpage?


PS I lost password for original posting and reset password lock me off.

Thank you. Thank you.
Mar 15 '12 #3

Expert Mod 10K+
P: 12,422
I can't give you everything. I want to see an attempt on your part. The steps are:
  1. Create a date variable.
  2. Populate it with the birth date.
  3. Use the aforementioned function to set the year to the year of the birth date plus 16

If you have trouble understanding the step by step instructions, you should look into a javascript tutorial before continuing with the project.
Mar 15 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.