工具 指南
calculators 免费 无需注册

年龄计算器

以年、月、日、时、分精确计算您的年龄。

正在加载工具…

关于此工具

输入出生日期和可选的目标日期,获取精确到秒的年龄,以及距下次生日的天数。

使用方法

  1. 1 使用日期选择器输入您的出生日期。
  2. 2 将目标日期保留为今天,或更改为计算特定日期的年龄。
  3. 3 以年、月、日、时、分精确计算您的年龄。
  4. 4 在底部查看距您下次生日还有多少天。

How exact age is actually counted

Your age sounds simple, but stating it precisely is a calendar problem, not just arithmetic on a number of days. This calculator reports age the way people, doctors, and the law actually count it: in whole calendar years, then months, then days. It does not divide elapsed days by 365.25 — that shortcut drifts by a day or more and gives odd fractional results. Instead it subtracts the calendar components and "borrows" when needed, exactly as you would do subtraction by hand.

The logic works like this. Start with the difference in years, months, and days between your birth date and the target date. If the day-of-month comes out negative (the target day is earlier in the month than your birth day), borrow one month and add the number of days in the previous month. If the month then comes out negative, borrow one year and add 12 months. Because the "days in the previous month" value comes from the real calendar, February's 28 or 29 days and the 30- versus 31-day months are all handled correctly, and leap years are exact without any fudge factor.

A worked example

Suppose you were born on 1998-03-15 and the target date is 2026-06-08.

  • Years: 2026 − 1998 = 28. Months: 6 − 3 = 3. Days: 8 − 15 = −7.
  • Days are negative, so borrow a month: take the days in the month before June (May, 31 days) → 8 − 15 + 31 = 24 days, and reduce months by one → 3 − 1 = 2.
  • Months are now positive, so no further borrowing.

Result: 28 years, 2 months, 24 days. The tool also shows totals that flatten this into a single unit — total days, weeks, and hours — and counts down the days until your next birthday by finding the next 15 March after the target date.

Why total days and calendar age differ

People sometimes expect "years × 365" to match the total-days figure. It never quite does, and that is correct. Over 28 years there are seven leap days, so the total-days count is larger than a naive multiplication. This is also why the same person can be "28 years old" yet have lived a number of days that doesn't divide evenly by 365. The calculator keeps these two views separate on purpose: the calendar breakdown for how age is normally stated, and the running totals for when you genuinely need the elapsed duration.

Use cases beyond birthdays

  • Eligibility checks. Confirm someone meets an age threshold on a specific future or past date — voting, a licence, a pension, a school cut-off.
  • Medical and developmental tracking. Infant age in months and days is clinically meaningful; the calendar-month method matches how paediatric milestones are recorded.
  • Anniversaries and tenure. Set the birth field to a wedding date, a hire date, or a project kickoff to see exact elapsed time and "days until" the next anniversary.
  • Anything with a start date. A warranty, a passport, a domain registration, a pet's age — the tool computes elapsed time for any two dates, not just human birthdays.

Tips and edge cases

  • Backdate or forward-date freely. Leave the target as today for your current age, or set a future date to find out how old you'll be at an event. The tool refuses target dates earlier than the birth date and tells you so.
  • The leap-day birthday question. If you were born on 29 February, your exact age is unambiguous here because it counts real elapsed calendar time. In non-leap years there is genuine ambiguity about which day "counts" as your birthday legally (28 February or 1 March, depending on jurisdiction) — that is a legal convention, not a calculation error.
  • Time zones and the clock. The calculation works on calendar dates, so it ignores the hour of birth. If you need age down to the minute, remember that the day you were born versus the day you cross a midnight boundary in a different time zone can shift the count by one day.
  • Order matters in borrowing. A common manual mistake is borrowing days using the target month's length instead of the previous month's. Doing it the other way, as this tool does, is what keeps end-of-month dates accurate.

常见问题

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}