Age Calculator
More information about your age
Total Years: | 00 |
Total Months: | 00 |
Total Weeks: | 00 |
Total Days: | 00 |
Total Hours: | 00 |
Total Minutes: | 00 |
Total Seconds: | 00 |
Are you curious about how old you are in days, months, or years? Use our free age calculator tool to find out! This online tool is easy to use and provides accurate results.
Why Use Our Age Calculator?
Our age calculator is a useful tool that can help you determine your age in various units, including days, months, and years. You may want to use this tool for various reasons:
- To determine your exact age on a specific date
- To calculate the age difference between two people
- To find out your age in months or days
How to Use Our Age Calculator
Using our age calculator tool is easy. Follow these simple steps:
- Select your birthdate from the calendar
- Select the current date from the calendar or enter it manually
- Click on the "Calculate Age" button
Our tool will then calculate your age in years, months, days, hours, minutes, and seconds. You can also see your age in months and days only.
var inputtoday = document.getElementById('ageDate'); var d = new Date(); var nowmonth = d.getMonth() + 1; var nowdate = d.getDate(); var nowyear = d.getFullYear(); var dateStr = nowdate + "/" + nowmonth + "/" + nowyear; inputtoday.value = dateStr; function formatDateInput(input) { // Get input value and remove non-numeric characters let value = input.value.replace(/\D/g, ''); // Format value as dd/mm/yyyy if (value.length > 4) { value = value.slice(0, 2) + '/' + value.slice(2, 4) + '/' + value.slice(4, 8); } else if (value.length > 2) { value = value.slice(0, 2) + '/' + value.slice(2, 4); } // Update input value input.value = value; } function calculateAge() { // Get input values as dates let dob = new Date(document.getElementById('dob').value); let ageDate = new Date(document.getElementById('ageDate').value); // If age date is not specified, use today's date if (isNaN(ageDate.getTime())) { ageDate = new Date(); } // Calculate age in years, months, and days let ageInMs = ageDate - dob; let ageInDays = ageInMs / (1000 * 60 * 60 * 24); let ageInYears = Math.floor(ageInDays / 365); let ageInMonths = Math.floor((ageInDays % 365) / 30); let ageInDaysLeft = Math.floor((ageInDays % 365) % 30); // Display age let age = document.getElementById('age'); age.innerHTML = "Your age is: " + ageInYears + " years, " + ageInMonths + " months, " + ageInDaysLeft + " days."; document.getElementById("total-years").innerHTML = Math.floor((ageDate - (dob)) / 1000 / 86400 / 365); document.getElementById("total-months").innerHTML = Math.floor((ageDate - (dob)) / 1000 / 86400 / 365 * 12); document.getElementById("total-weeks").innerHTML = Math.floor((ageDate - (dob)) / 1000 / 86400 / 7); var tvds = Math.floor((ageDate - (dob)) / 1000 / 86400); document.getElementById("total-days").innerHTML = tvds; document.getElementById("total-hours").innerHTML = Math.floor(tvds * 24); document.getElementById("total-minutes").innerHTML = Math.floor(tvds * 24 * 60); document.getElementById("total-seconds").innerHTML = Math.floor(tvds * 24 * 60 * 60); }