{
  "id": "birthday",
  "version": "51fc007bdd10",
  "status": "published",
  "name": "Birthday Calculator",
  "question": "How many days until my birthday?",
  "summary": "Counts the days to your next birthday and gives its date, the age you turn, the day of the week you were born, and your age and days lived so far.",
  "category": "days",
  "subcategory": "age",
  "url": "https://www.acalculator.org/days/birthday-calculator",
  "markdown": "https://www.acalculator.org/days/birthday-calculator.md",
  "kind": "function",
  "method": "next birthday = the date of birth plus the fewest whole years (at least 1) that is on or after the count-from date; days until = next birthday − count-from date.",
  "assumptions": [
    "The next birthday is the first birthday on or after the count-from date, so on your birthday the count is 0.",
    "A February 29 birthday falls on February 28 in years that are not leap years.",
    "Dates are calendar days on the Gregorian calendar (1600 to 2400), with no time of day or time zone.",
    "Age is whole years, then whole months, then days; month ends clamp (January 31 plus one month is February 28 or 29).",
    "A date of birth after the count-from date gives no answer."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "birth": {
        "title": "Date of birth",
        "description": "Your birthday, with the year you were born.",
        "type": "string",
        "format": "date"
      },
      "on": {
        "title": "Count from",
        "description": "The date to count from. Today, unless you change it.",
        "type": "string",
        "format": "date"
      }
    }
  },
  "outputs": {
    "days": {
      "label": "Days until your birthday",
      "description": "Days from the count-from date to the next birthday; 0 when the birthday is that day.",
      "format": "integer"
    },
    "next": {
      "label": "Next birthday",
      "description": "The date of the next birthday on or after the count-from date, with its weekday.",
      "format": "date-long"
    },
    "countdown": {
      "label": "Countdown",
      "description": "The days to the next birthday in words: “today”, “1 day to go”, or “N days to go”.",
      "format": "text"
    },
    "turning": {
      "label": "Age on that birthday",
      "description": "The age in whole years reached on the next birthday.",
      "format": "integer"
    },
    "bornOn": {
      "label": "Day you were born",
      "description": "The day of the week of the date of birth.",
      "format": "text"
    },
    "age": {
      "label": "Age now",
      "description": "The age on the count-from date in whole years, months, and days.",
      "format": "duration"
    },
    "daysLived": {
      "label": "Days lived",
      "description": "Days from the date of birth to the count-from date.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "birth": "1995-06-15",
      "on": "2026-09-29"
    },
    "outputs": {
      "days": 259,
      "next": "2027-06-15",
      "countdown": "259 days to go",
      "turning": 32,
      "bornOn": "Thursday",
      "age": {
        "years": 31,
        "months": 3,
        "days": 14
      },
      "daysLived": 11429
    },
    "text": "Your next birthday is Tuesday, June 15, 2027 (259 days to go), when you turn 32."
  },
  "examples": [
    {
      "given": {
        "birth": "1995-06-15",
        "on": "2026-09-27"
      },
      "expect": {
        "countdown": "261 days to go",
        "days": 261,
        "next": "2027-06-15",
        "turning": 32,
        "bornOn": "Thursday",
        "age": {
          "years": 31,
          "months": 3,
          "days": 12
        },
        "daysLived": 11427
      },
      "source": "hand calculation in content.mdx; Python: (date(2027,6,15) - date(2026,9,27)).days = 261"
    },
    {
      "given": {
        "birth": "2000-02-29",
        "on": "2026-09-27"
      },
      "expect": {
        "days": 154,
        "countdown": "154 days to go",
        "next": "2027-02-28",
        "turning": 27,
        "bornOn": "Tuesday"
      },
      "source": "hand calculation in content.mdx; Python: (date(2027,2,28) - date(2026,9,27)).days = 154"
    },
    {
      "given": {
        "birth": "1990-09-27",
        "on": "2026-09-27"
      },
      "expect": {
        "days": 0,
        "countdown": "today",
        "next": "2026-09-27",
        "turning": 36,
        "age": {
          "years": 36,
          "months": 0,
          "days": 0
        }
      },
      "source": "hand calculation in content.mdx: 2026 − 1990 = 36"
    },
    {
      "given": {
        "birth": "2026-09-27",
        "on": "2026-09-27"
      },
      "expect": {
        "days": 365,
        "countdown": "365 days to go",
        "next": "2027-09-27",
        "turning": 1,
        "daysLived": 0
      },
      "source": "hand calculation in content.mdx: September 27, 2026 to September 27, 2027 is 365 days"
    },
    {
      "given": {
        "birth": "1969-07-20",
        "on": "2026-12-31"
      },
      "expect": {
        "countdown": "201 days to go",
        "days": 201,
        "next": "2027-07-20",
        "turning": 58,
        "bornOn": "Sunday"
      },
      "source": "hand calculation in content.mdx; July 20, 1969 (the Apollo 11 Moon landing) was a Sunday; Python: date(1969,7,20).weekday() = 6 (Sunday)"
    }
  ],
  "sources": [
    "U.S. Naval Observatory, Leap Years: the Gregorian leap year rule. https://aa.usno.navy.mil/faq/leap_years",
    "NASA, Apollo 11 Mission Overview: landed on the Moon on July 20, 1969. https://www.nasa.gov/mission/apollo-11/"
  ],
  "related": [
    "dob",
    "age-difference",
    "date",
    "dog-age"
  ],
  "changelog": [
    {
      "date": "2026-09-28",
      "note": "New Countdown line: “today”, “1 day to go”, or “N days to go”; the answer uses it."
    }
  ]
}
