Useful Online Tool for Age and Date Calculations – Discussion on SitePoint

i everyone,

Sometimes while working on different projects, we need quick and accurate calculations related to dates — for example, finding the exact age from a birthdate, or calculating differences between two dates in both Gregorian and Hijri calendars.

I recently came across a tool that provides these features in a very simple way. What I like about it is:

  • It supports both Gregorian (ميلادي) and Hijri (هجري) dates.

  • Gives detailed results in years, months, and days.

  • Helpful for educational projects, event planning, or just personal use.

If anyone is interested, you can check it here:
:backhand_index_pointing_right: Age & Hijri Date Calculator

Would love to hear if anyone here on SitePoint has used similar tools or has experience building such calculators with JavaScript/PHP.

Thanks!


const hijriDateString = new Intl.DateTimeFormat('ar-SA', {
  calendar: 'islamic',
  year: 'numeric',
  month: 'long',
  day: 'numeric'
}).format(gregorianDate);

There’s your calculator. It’s already part of the Javascript engine.