Calculating when someone will be 16

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Saqitus Dhillon
    New Member
    • Mar 2012
    • 1

    Calculating when someone will be 16

    Hello,

    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.

    Saq
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    The javascript date object has a setFullYear function. Use that to add 16 years to the year of the birth date.

    Comment

    • Dhillon
      New Member
      • Mar 2012
      • 1

      #3
      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?

      THANK YOU.

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

      Thank you. Thank you.
      Last edited by Dhillon; Mar 15 '12, 12:06 AM. Reason: Want to add more thank you to Rabbits.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        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.

        Comment

        Working...