{
  "address": "3415f8d8474882a814ad65b0a0e13216",
  "category": "other",
  "question": "What is the exact age, in years, months, and days, of someone born on 1990-06-15 as of 2026-09-30?",
  "answer": "36 years, 3 months, 15 days",
  "askedBy": {
    "kind": "guest",
    "display": "method deck",
    "stamped": false,
    "id": null
  },
  "answeredBy": "method",
  "madeAt": "2026-09-30T22:39:30.722Z",
  "validUntil": null,
  "validityClass": "forever",
  "sources": [
    {
      "label": "chrono-Compatible Low-Level Date Algorithms",
      "url": "https://howardhinnant.github.io/date_algorithms.html"
    }
  ],
  "supersedes": null,
  "supersededBy": null,
  "isSeed": false,
  "seedSource": null,
  "seedAttribution": null,
  "duplicateOfQid": null,
  "publishedAt": null,
  "unpublishedAt": null,
  "voteCount": 0,
  "queuedForSubstrate": false,
  "answerMethod": "method",
  "unsourced": false,
  "source": {
    "kind": "url",
    "value": "https://howardhinnant.github.io/date_algorithms.html",
    "retrieved_utc": "2026-09-30T19:41:35Z"
  },
  "qsha256": "80547f180941e54e7f1c9a0b9335c43e71b656dea21b16002e52e2138a263c3b",
  "runOne": null,
  "cardContractVersion": "card_contract/1",
  "deck_id": "method-deck",
  "deck_title": "Method Deck",
  "method": {
    "name": "Age in years, months, and days",
    "version": "1",
    "source_url_or_file": "methods/age-in-years-months-days.cjs",
    "sha256_of_method_file": "0faf80f4f9e159fdfdcfd6d78e0b8aee977ffc4f5eabe7c086af63d2368a7398"
  },
  "receipt": {
    "inSubstrate": false,
    "local": true,
    "modelCallsAtMint": 0,
    "tokensAtMint": 0
  },
  "method_deck": {
    "inputs": [
      {
        "name": "birth_date",
        "type": "string",
        "format": "date",
        "required": true,
        "description": "ISO 8601 birth date, YYYY-MM-DD"
      },
      {
        "name": "as_of_date",
        "type": "string",
        "format": "date",
        "required": true,
        "description": "ISO 8601 date to compute the age as of, must be on or after birth_date"
      }
    ],
    "outputs": [
      {
        "name": "years",
        "unit": "years",
        "description": "Completed years"
      },
      {
        "name": "months",
        "unit": "months",
        "description": "Completed months beyond the years"
      },
      {
        "name": "days",
        "unit": "days",
        "description": "Remaining days beyond the years and months"
      }
    ],
    "steps": [
      "Parse birth_date and as_of_date as proleptic Gregorian civil dates; require as_of_date on or after birth_date (checked via day-number, Hinnant days_from_civil, cited above).",
      "years = as_of.year - birth.year; months = as_of.month - birth.month; days = as_of.day - birth.day.",
      "If days is negative: subtract 1 from months, and walk back one calendar month at a time from as_of_date's month, adding that month's day count to days, repeating until days is no longer negative (this handles the rare case where the birth day-of-month exceeds the days in the immediately preceding month, e.g. a day-31 birth date compared against an early day in a short month).",
      "If months is still negative after that, subtract 1 from years and add 12 to months.",
      "The result is the completed years, months, and days of age as of as_of_date."
    ],
    "constants": [],
    "examples": [
      {
        "name": "worked example",
        "inputs": {
          "birth_date": "1990-06-15",
          "as_of_date": "2026-09-30"
        },
        "expected": {
          "answer": "36 years, 3 months, 15 days"
        },
        "check": "1990-06-15 to 2026-06-15 is 36 years; 2026-06-15 to 2026-09-15 is 3 months; 2026-09-15 to 2026-09-30 is 15 days"
      },
      {
        "name": "test vector: single-month borrow",
        "inputs": {
          "birth_date": "1995-11-20",
          "as_of_date": "2026-03-05"
        },
        "expected": {
          "answer": "30 years, 3 months, 13 days"
        },
        "check": "1995-11-20 to 2025-11-20 is 30 years; to 2026-02-20 is 3 more months; Feb 20 to Mar 5, 2026 (28-day Feb) is 13 days"
      },
      {
        "name": "test vector: same-day age is exact years",
        "inputs": {
          "birth_date": "2000-02-29",
          "as_of_date": "2024-02-29"
        },
        "expected": {
          "answer": "24 years, 0 months, 0 days"
        },
        "check": "2024 is a leap year so Feb 29 exists; exactly 24 full years elapsed with no leftover months or days"
      }
    ],
    "disclaimer": null,
    "deck_category": "dates"
  },
  "status": "minted",
  "kind": "method",
  "provenanceClass": "own_question",
  "provenance": {
    "schema": "card_provenance/2.0.0",
    "chain": [
      {
        "source": {
          "kind": "url",
          "value": "https://howardhinnant.github.io/date_algorithms.html",
          "retrieved_utc": "2026-09-30T19:41:35Z"
        },
        "sha256": "a3ef117ab641631d1b1d5d174c3433ad3c8ee278a217244873b2997d987e9a91",
        "supersedes": null,
        "added_utc": "2026-09-30T22:39:30.722Z",
        "added_by": "method:Age in years, months, and days",
        "why": "the method that computed this answer",
        "check": null,
        "status_label": "pending",
        "signature": null
      }
    ]
  }
}
