Date of birth Calculator | Age Calculator

Date of birth Calculator | Age Calculator

Date of birth calculator : Here you can find exact date month year with the calculation provided by you. to know your date of birth details you have to enter month of your birth and date,year and then select calculate age now you will get the exact age of yours. date of birth calculatorAge calculator : After entering your date,month, year you will get the age of yours.

// document.getElementById("age").innerHTML = d;

//}

var mdate = birthDate.toString();
var yearThen = parseInt(mdate.substring(0,4), 10);
var monthThen = parseInt(mdate.substring(5,7), 10);
var dayThen = parseInt(mdate.substring(8,10), 10);

var today = new Date();
var birthday = new Date(yearThen, monthThen-1, dayThen);
// alert(today.valueOf() + " " + birthday.valueOf());
var differenceInMilisecond = today.valueOf() - birthday.valueOf();
// alert(differenceInMilisecond);

var year_age = Math.floor(differenceInMilisecond / 31536000000);
var day_age = Math.floor((differenceInMilisecond % 31536000000) / 86400000);

if ((today.getMonth() == birthday.getMonth()) && (today.getDate() == birthday.getDate())) {
alert("Happy Birthday Dear !!! Enjoy Your Day");
//document.getElementById("age").innerHTML = ("Happy Birthday Dear");

}

var month_age = Math.floor(day_age/30);

day_age = day_age % 30;

var tMnt= (month_age + (year_age*12));
var tDays =(tMnt*30) + day_age;

if (isNaN(year_age) || isNaN(month_age) || isNaN(day_age)) {
document.getElementById("age").innerHTML = ("Invalid birthday - Please try again!");
}
else {
document.getElementById("age").innerHTML = year_age + " years " + month_age + " months " + day_age + " days"
+ "
or
"
+ tMnt + " months " + day_age + " days"
+ "
or
"
+ tDays + " days"
+ "
or
"
+ tDays*24 + " hours"
+ "
or
"
+ tDays*24*3600 + " seconds"
+ "
or
"
+ tDays*24*3600*1000 + " miliseconds" ;
}

}


Date Of Birth:

Age:


Leave a Reply

error: Content is protected !!
%d bloggers like this: