{
  "id": "days-until-the-29th",
  "version": "aa65ee15de5a",
  "status": "published",
  "name": "Days Until the 29th",
  "question": "Days until the 29th",
  "summary": "Counts the days from today, or any date you choose, to the next 29th of a month, with its date and the 29th after it.",
  "category": "days",
  "subcategory": "countdowns",
  "url": "https://www.acalculator.org/days/days-until-the-29th",
  "markdown": "https://www.acalculator.org/days/days-until-the-29th.md",
  "kind": "function",
  "method": "Find the first date on or after the start date that is the 29th of its month, skipping months that have no 29th, then count the days from the start date to it.",
  "assumptions": [
    "On the 29th, the count is 0, and the 29th after is the 29th of the next month that has one.",
    "February has a 29th only in a leap year, so the count skips to the 29th of the next month that has one. A leap year is a year divisible by 4, except a century year not divisible by 400 (2000 and 2400 are leap years; 1900 and 2100 are not).",
    "The start date itself is not counted: from the day before, the count is 1.",
    "Dates are calendar days with no time of day, so a time zone or a daylight-saving change never adds or loses a day.",
    "Start dates from January 1, 1900 to December 31, 2400 work."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "from": {
        "title": "Count from",
        "description": "The date to count from. Today, unless you change it.",
        "type": "string",
        "format": "date"
      }
    }
  },
  "outputs": {
    "days": {
      "label": "Days until the 29th",
      "description": "Whole days from the start date to the next 29th of a month; 0 when the start date is the 29th.",
      "format": "integer"
    },
    "date": {
      "label": "Next 29th",
      "description": "The first date on or after the start date that is the 29th of its month.",
      "format": "date-long"
    },
    "after": {
      "label": "The 29th after",
      "description": "The next 29th after that date.",
      "format": "date-long"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "from": "2026-10-19"
    },
    "outputs": {
      "days": 10,
      "date": "2026-10-29",
      "after": "2026-11-29"
    },
    "text": "From October 19, 2026, there are 10 days until the 29th, Thursday, October 29, 2026."
  },
  "examples": [
    {
      "given": {
        "from": "2026-10-19"
      },
      "expect": {
        "date": "2026-10-29",
        "days": 10,
        "after": "2026-11-29"
      },
      "source": "IETF RFC 3339, section 5.7 (days in each month) and Appendix C (the leap year rule) (https://www.rfc-editor.org/rfc/rfc3339); Python 3 datetime, walking one day at a time from the start date (docs/progress/WP-141/truth_days.py)"
    },
    {
      "given": {
        "from": "2026-12-31"
      },
      "expect": {
        "date": "2027-01-29",
        "days": 29,
        "after": "2027-03-29"
      },
      "source": "IETF RFC 3339, section 5.7 (days in each month) and Appendix C (the leap year rule) (https://www.rfc-editor.org/rfc/rfc3339); Python 3 datetime, walking one day at a time from the start date (docs/progress/WP-141/truth_days.py)"
    },
    {
      "given": {
        "from": "2027-02-01"
      },
      "expect": {
        "date": "2027-03-29",
        "days": 56,
        "after": "2027-04-29"
      },
      "source": "IETF RFC 3339, section 5.7 (days in each month) and Appendix C (the leap year rule) (https://www.rfc-editor.org/rfc/rfc3339); Python 3 datetime, walking one day at a time from the start date (docs/progress/WP-141/truth_days.py)"
    },
    {
      "given": {
        "from": "2028-02-15"
      },
      "expect": {
        "date": "2028-02-29",
        "days": 14,
        "after": "2028-03-29"
      },
      "source": "IETF RFC 3339, section 5.7 (days in each month) and Appendix C (the leap year rule) (https://www.rfc-editor.org/rfc/rfc3339); Python 3 datetime, walking one day at a time from the start date (docs/progress/WP-141/truth_days.py)"
    },
    {
      "given": {
        "from": "2027-01-29"
      },
      "expect": {
        "date": "2027-01-29",
        "days": 0,
        "after": "2027-03-29"
      },
      "source": "IETF RFC 3339, section 5.7 (days in each month) and Appendix C (the leap year rule) (https://www.rfc-editor.org/rfc/rfc3339); Python 3 datetime, walking one day at a time from the start date (docs/progress/WP-141/truth_days.py)"
    }
  ],
  "sources": [
    "IETF RFC 3339, Date and Time on the Internet: Timestamps, section 5.7 (the days in each month) and Appendix C (the leap year rule). https://www.rfc-editor.org/rfc/rfc3339",
    "U.S. Naval Observatory, Leap Years: the Gregorian leap year rule. https://aa.usno.navy.mil/faq/leap_years"
  ],
  "related": [
    "days-until-the-28th",
    "days-until-the-30th",
    "days-until",
    "days-from-today"
  ],
  "changelog": []
}
