{
  "id": "anniversary",
  "version": "d405b49fb67a",
  "status": "published",
  "name": "Anniversary Calculator",
  "question": "How long until our next anniversary?",
  "summary": "Counts how long you have been married or together in years, months and days, and gives the date of your next anniversary, which one it is and the next milestone.",
  "category": "days",
  "subcategory": "dates",
  "url": "https://www.acalculator.org/days/anniversary-calculator",
  "markdown": "https://www.acalculator.org/days/anniversary-calculator.md",
  "kind": "function",
  "method": "next anniversary = the wedding date plus the fewest whole years (at least 1) on or after the count-from date; days until = next − count-from date; time together = whole years, months, days.",
  "assumptions": [
    "A February 29 wedding date has its anniversary on February 28 in common years.",
    "On the anniversary itself the count is 0 and that anniversary is the next one.",
    "Milestones are the 1st, every 5th up to the 80th, with the traditional names in Wikipedia’s list; names vary by country."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "start": {
        "title": "Wedding date",
        "description": "The date of your wedding, or the day you got together.",
        "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 the next anniversary",
      "description": "Days from the count-from date to the next anniversary; 0 when it is that day.",
      "format": "integer"
    },
    "next": {
      "label": "Next anniversary",
      "description": "The date of the next anniversary.",
      "format": "date-long"
    },
    "which": {
      "label": "Which anniversary",
      "description": "The number of the next anniversary.",
      "format": "text"
    },
    "together": {
      "label": "Time together",
      "description": "Whole years, months and days from the wedding date to the count-from date.",
      "format": "duration"
    },
    "totalDays": {
      "label": "Days together",
      "description": "Days from the wedding date to the count-from date.",
      "format": "integer"
    },
    "milestone": {
      "label": "Next milestone",
      "description": "The next 1st, 5th, 10th or later milestone anniversary on or after the count-from date, with its traditional name.",
      "format": "text"
    },
    "milestoneDate": {
      "label": "Milestone date",
      "description": "The date of the next milestone anniversary.",
      "format": "date-long"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "start": "2015-06-20",
      "on": "2026-10-05"
    },
    "outputs": {
      "days": 258,
      "next": "2027-06-20",
      "which": "12th",
      "together": {
        "years": 11,
        "months": 3,
        "days": 15
      },
      "totalDays": 4125,
      "milestone": "15th (crystal)",
      "milestoneDate": "2030-06-20"
    },
    "text": "Your 12th anniversary is on Sunday, June 20, 2027, in 258 days."
  },
  "examples": [
    {
      "given": {
        "start": "2015-06-20",
        "on": "2026-10-05"
      },
      "expect": {
        "days": 258,
        "next": "2027-06-20",
        "which": "12th",
        "together": {
          "years": 11,
          "months": 3,
          "days": 15
        },
        "totalDays": 4125,
        "milestone": "15th (crystal)",
        "milestoneDate": "2030-06-20"
      },
      "source": "hand calculation in content.mdx; Python: (date(2027,6,20) − date(2026,10,5)).days = 258; Wikipedia, Wedding anniversary (traditional names: 25th silver, 30th pearl, 40th ruby, 50th gold, 60th diamond), https://en.wikipedia.org/wiki/Wedding_anniversary (retrieved 2026-10-05)"
    },
    {
      "given": {
        "start": "2001-10-05",
        "on": "2026-10-05"
      },
      "expect": {
        "days": 0,
        "which": "25th",
        "milestone": "25th (silver)",
        "together": {
          "years": 25,
          "months": 0,
          "days": 0
        }
      },
      "source": "hand calculation in content.mdx; Wikipedia, Wedding anniversary (traditional names: 25th silver, 30th pearl, 40th ruby, 50th gold, 60th diamond), https://en.wikipedia.org/wiki/Wedding_anniversary (retrieved 2026-10-05)"
    },
    {
      "given": {
        "start": "2004-02-29",
        "on": "2026-03-01"
      },
      "expect": {
        "days": 364,
        "next": "2027-02-28",
        "which": "23rd",
        "milestone": "25th (silver)",
        "milestoneDate": "2029-02-28"
      },
      "source": "hand calculation in content.mdx; U.S. Naval Observatory, Leap Years: the Gregorian leap year rule, https://aa.usno.navy.mil/faq/leap_years (retrieved 2026-10-05); Wikipedia, Wedding anniversary (traditional names: 25th silver, 30th pearl, 40th ruby, 50th gold, 60th diamond), https://en.wikipedia.org/wiki/Wedding_anniversary (retrieved 2026-10-05)"
    }
  ],
  "sources": [
    "Wikipedia, Wedding anniversary: the traditional names of anniversaries. https://en.wikipedia.org/wiki/Wedding_anniversary (retrieved 2026-10-05)",
    "U.S. Naval Observatory, Leap Years: the Gregorian leap year rule. https://aa.usno.navy.mil/faq/leap_years (retrieved 2026-10-05)"
  ],
  "related": [
    "birthday",
    "days-between-dates",
    "date"
  ],
  "changelog": []
}
