Age Calculator by Year (Gregorian & Hijri)
About this app
Calculate your age based on the Gregorian or Hijri year of birth.
Age Calculator by Year (Gregorian & Hijri) Age Calculator by Year (Gregorian & Hijri) Gregorian Calendar Enter your Gregorian birth year: Calculate Age Hijri Calendar Enter your Hijri birth year: Calculate Age
Related apps
Put this on your site
Source
<!DOCTYPE html>
<html>
<head>
<title>Age Calculator by Year (Gregorian & Hijri)</title>
<meta name='description' content='Calculate your age based on the Gregorian or Hijri year of birth.'>
<meta name='keywords' content='age, calculator, Gregorian, Hijri, Islamic calendar'>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin: 20px;
}
#result, #resultHijri {
font-size: 24px;
margin-top: 20px;
}
</style>
</head>
<body>
<h1>Age Calculator by Year (Gregorian & Hijri)</h1>
<div>
<h2>Gregorian Calendar</h2>
<p>Enter your Gregorian birth year:</p>
<input type='number' id='birthYearGregorian' placeholder='e.g., 1990'>
<button onclick='calculateAgeGregorian()'>Calculate Age</button>
<div id='result'></div>
</div>
<div>
<h2>Hijri Calendar</h2>
<p>Enter your Hijri birth year:</p>
<input type='number' id='birthYearHijri' placeholder='e.g., 1410'>
<button onclick='calculateAgeHijri()'>Calculate Age</button>
<div id='resultHijri'></div>
</div>
<script>
function calculateAgeGregorian() {
const birthYear = document.getElementById('birthYearGregorian').value;
const currentYear = new Date().getFullYear();
const age = currentYear - birthYear;
document.getElementById('result').innerText = 'Your age in Gregorian years is ' + age + ' years.';
}
function calculateAgeHijri() {
const birthYear = parseInt(document.getElementById('birthYearHijri').value);
const currentHijriYear = 1444; // Current Hijri year as of 2023
const age = currentHijriYear - birthYear;
document.getElementById('resultHijri').innerText = 'Your age in Hijri years is ' + age + '.';
}
</script>
</body>
</html>
NEW APPS
These are apps made by the community!