Time & date calculator

Age Calculator

Calculate exact age from a date of birth in years, months, and days, plus total days, weeks, months, and hours lived, the day of the week you were born, and a next-birthday countdown — with formula examples for Excel, SQL, PHP, Java, Oracle, and Access.

Calendar-correct Any "as of" date Excel/SQL/code formulas

Runs entirely in your browser — nothing you enter is stored or sent anywhere.

Calculate age

Defaults to today.

Age as of January 5, 2026

Exact age

35 years, 6 months, 21 days

Born on a Friday

Total days lived

12,988

Total weeks lived

1,855 + 3d

Total months lived

426

Total hours lived

311,712

161 days until turning 36

Next birthday: June 15, 2026

How this calculator works

Age is counted the same way a person counts it by hand: complete years since the birth date, then complete months since the most recent birthday, then the remaining days since the most recent full month. This calendar-correct method is deliberately different from dividing total days lived by 365 (or 365.25) — that shortcut drifts because months have different lengths and leap years add an extra day, so it can be off by a day or more depending on exactly which months and leap years fall inside the span.

Total days, weeks, and hours lived are computed separately, directly from the calendar-day gap between the two dates — an exact count, not an estimate.

Worked example

Someone born on June 15, 1990, with age calculated as of August 5, 2026:

  • From June 15, 1990 to June 15, 2026 is exactly 36 complete years.
  • From June 15, 2026 to July 15, 2026 is 1 complete month.
  • From July 15, 2026 to August 5, 2026 is 21 days (July has 31 days: 16 remaining days in July, plus 5 days into August).

Exact age: 36 years, 1 month, 21 days — 13,200 total days lived, born on a Friday, with a next birthday on June 15, 2027 (turning 37).

Formulas in Excel, SQL & code

The same calendar-correct method this calculator uses, in the tools people most often ask about. Each returns complete years (and, where shown, complete months and remaining days) as of today — swap in a specific date where noted.

Excel / Google Sheets

=DATEDIF(B1,TODAY(),"y")&" years, "&DATEDIF(B1,TODAY(),"ym")&" months, "&DATEDIF(B1,TODAY(),"md")&" days"

B1 holds the birth date. DATEDIF’s “y” gives complete years, “ym” gives remaining months, and “md” gives remaining days — the same three-part breakdown this page shows. Works identically in Google Sheets.

SQL Server

SELECT DATEDIFF(YEAR, birth_date, GETDATE())
  - CASE WHEN (MONTH(birth_date) > MONTH(GETDATE()))
      OR (MONTH(birth_date) = MONTH(GETDATE()) AND DAY(birth_date) > DAY(GETDATE()))
    THEN 1 ELSE 0 END AS age;

DATEDIFF(YEAR, ...) alone counts calendar-year boundaries crossed, not complete years — the CASE expression subtracts one when this year’s birthday hasn’t happened yet.

MySQL / MariaDB

SELECT TIMESTAMPDIFF(YEAR, birth_date, CURDATE()) AS age;

TIMESTAMPDIFF with a YEAR unit already accounts for whether the birthday has occurred this year, so no extra adjustment is needed.

PHP

$birth = new DateTime('1990-06-15');
$today = new DateTime('today');
$age = $birth->diff($today);
echo $age->y . " years, " . $age->m . " months, " . $age->d . " days";

Java

LocalDate birthDate = LocalDate.of(1990, 6, 15);
LocalDate today = LocalDate.now();
Period age = Period.between(birthDate, today);
System.out.println(age.getYears() + " years, " + age.getMonths()
  + " months, " + age.getDays() + " days");

Oracle

SELECT FLOOR(MONTHS_BETWEEN(SYSDATE, birth_date) / 12) AS age
FROM dual;

MONTHS_BETWEEN returns a fractional month count between the two dates; dividing by 12 and flooring gives complete years.

MS Access

Age: DateDiff("yyyy",[BirthDate],Date()) - IIf(Format([BirthDate],"mmdd")>Format(Date(),"mmdd"),1,0)

Same logic as the SQL Server example: DateDiff(“yyyy”, ...) counts year boundaries, and the IIf/Format comparison subtracts one if this year’s birthday hasn’t occurred yet.

SAS

age = intck('year', birth_date, today(), 'continuous');

The “continuous” alignment argument makes INTCK count whole elapsed years rather than calendar-year boundaries crossed — without it, INTCK would overcount the same way a plain year subtraction does.

Limitations

  • No time-of-day precision. Only a birth date is known, not a birth time, so hours/minutes lived are exact multiples of a full day, not precise to the minute.
  • No time zone handling. A birth date is treated as a plain calendar date, the same everywhere, rather than an instant that shifts with time zone — this is intentional, not an oversight.
  • February 29 uses a convention, not a rule. Non-leap-year birthdays are observed on February 28 for the next-birthday countdown; some organizations use March 1 instead — check the specific rule if it matters for your situation.
  • Not a legal-age determination. Exactly which date someone becomes legally eligible for something (voting, driving, a purchase age) can follow jurisdiction-specific rules that differ from simple calendar age — confirm with an official source when it matters.

Sources and methodology

Age calculation: the complete-years/complete-months/remaining-days method is the standard calendar-correct approach used by date libraries generally (including the language/database examples above), not a bespoke algorithm.

Calendar: the proleptic Gregorian calendar, used consistently for all dates regardless of era.

Related calculators

Frequently asked questions

How is my exact age calculated?

The calculator counts complete years since your birth date, then complete months since your last birthday, then the remaining days since your last full month — the same way most people count age by hand. It is not a simple total-days-divided-by-365 approximation, which would drift over time because months and years are not all the same length.

Can I calculate my age as of a date other than today?

Yes — change the "Calculate age as of" field to any date on or after your birth date. This is useful for figuring out how old you were (or will be) on a specific past or future date, not just right now.

What day of the week was I born?

The result panel shows this directly under your exact age — computed straight from the calendar, the same proleptic Gregorian calendar used for all dates on this page.

How many total days, weeks, months, and hours have I been alive?

All shown together with your exact age. Total days is the true calendar-day count between your birth date and the "as of" date; total months is the same whole-months figure as the years/months/days breakdown (years × 12 + months), not an approximation; hours are simply days × 24, since only your birth date — not a birth time — is known.

How does the next-birthday countdown work?

It finds the next occurrence of your birth month and day on or after the "as of" date (rolling into next year if this year’s has already passed) and shows the days remaining and the age you’ll turn.

What happens if I was born on February 29?

In years that aren’t leap years, the countdown observes February 28 as the birthday — the most common convention. Your exact age in years/months/days is unaffected by this either way, since that’s computed directly from the calendar dates you entered, not from a recurring "birthday" concept.

Excel formula for age from date of birth?

Use DATEDIF, combining complete years, remaining months, and remaining days: =DATEDIF(B1,TODAY(),"y")&" years, "&DATEDIF(B1,TODAY(),"ym")&" months, "&DATEDIF(B1,TODAY(),"md")&" days" — where B1 holds the birth date. See the "Formulas in Excel, SQL & code" section below for the full breakdown and equivalents in SQL, PHP, Java, Oracle, and Access.

SQL formula for age from date of birth?

In MySQL/MariaDB: SELECT TIMESTAMPDIFF(YEAR, birth_date, CURDATE()); it already accounts for whether the birthday has occurred this year. SQL Server needs an explicit adjustment for the same reason — see the formulas section for the full query.

PHP age calculation from date of birth?

PHP’s DateTime::diff() does this correctly out of the box: (new DateTime($birthDate))->diff(new DateTime("today"))->y gives complete years, with ->m and ->d for the remaining months and days. Full example in the formulas section.

Java age calculation from date of birth?

java.time.Period is the standard, correct approach: Period.between(birthDate, today) returns getYears()/getMonths()/getDays() using the same calendar-correct method this calculator uses. Full example in the formulas section.

Oracle age calculation from date of birth and today?

The standard idiom is FLOOR(MONTHS_BETWEEN(SYSDATE, birth_date) / 12) — MONTHS_BETWEEN gives a fractional month count, and dividing by 12 then flooring gives complete years. Full example in the formulas section.

Access age calculation from date of birth?

MS Access commonly uses DateDiff("yyyy", [BirthDate], Date()) adjusted by comparing the month/day of the birth date against today, since DateDiff("yyyy", ...) alone counts calendar-year boundaries crossed, not complete years. Full formula in the formulas section.

Does this calculator account for time zones?

No — a birth date is a calendar date, not a specific moment in time, so no time zone conversion applies here. If you need to convert a specific date and time between time zones, use the separate Time Zone Converter instead.

Is this accurate enough for legal age requirements (voting, driving, drinking age, etc.)?

The arithmetic is standard and accurate, but "legal age" rules about exactly which date you become eligible (some jurisdictions count from the day before a birthday, for example) vary by jurisdiction and purpose. For anything with legal consequences, confirm the exact rule with an official source rather than relying on this calculator alone.

Does this store or send my birth date anywhere?

No. Every calculation runs entirely in your browser — nothing you enter is sent to or stored on our servers.

Time & date disclaimer

This calculator applies standard calendar-date arithmetic to the dates you enter. It does not implement jurisdiction-specific legal-age rules, and treats a February 29 birthday using the common (but not universal) convention described above. For anything with legal, contractual, or official consequences, confirm the exact rule with an authoritative source.

How we calculate · email us

Authorship & verification

Written and maintained by

  • Formula and examples verified on 5 August 2026
  • Educational estimate only

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.