Close Bitnami banner
Bitnami

Age Calculator

age calculator

Age is the length of time during which a being or thing has existed; or in other words, we can say that age is a period of human life, measured by years from birth. Age show signs of growing older. Would you like to know how much you are growing older? checkout our free age calculator here and let us know your feedback.

Please enter your date of birth here:

Date Of Birth:

 

Age:

Age Calculator

Age calculator is created on the basis of the most common age system so that it stays relevant for most of the people. This calculator helps you to calculate the age in years, months, days, hours, seconds and milliseconds. It is calculation is very simple.

Let see how it is work:

Age In Years, Months And Days

To calculate the years, months and days we simply used a formula
Formula:
day_in_milisec = 1000 * 60 * 60 * 24;
month_in_milisec = 1000 * 60 * 60 * 24 * 30;
diff_value_in_milisec = (today.valueOf() – birthday.valueOf());
year = diff_value_in_milisec /month_in_milis ;
Month = ((differenceInMilisecond % month_in_milisec) / day_in_milisec) / 30;
Days = ((differenceInMilisecond % month_in_milisec) / day_in_milisec) % 30;

Example
How above formula work? Here is a small example

Example:
Birthday = 8/8/1991

1000 * 60 * 60 * 24 = 86400000 (day_in_milisec)
1000 * 60 * 60 * 24 * 30 = 31536000000 (month_in_milisec)
diff_value_in_milisec = (today.valueOf() – birthday.valueOf()) * month_in_milisec
903465134347 = (1585054934347 – 681589800000)
year = diff_value_in_milisec /month_in_milis ;
28.648 = 903465134347/31536000000
Month = ((differenceInMilisecond % month_in_milisec) / day_in_milisec) / 30;
343 = ((903465134347%31536000000)/86400000)/30;
Days = ((differenceInMilisecond % month_in_milisec) / day_in_milisec) % 30;
26 = ((903465134347%31536000000)/86400000)%30;

Note: you have to calculate valueOf() function your self

 

 

About author View all posts Author website

Harshit Jain

Leave a Reply

Your email address will not be published. Required fields are marked *

Close Bitnami banner
Bitnami