{
  "id": "days-until",
  "version": "0fdb9d898cc3",
  "status": "published",
  "name": "Days Until Any Date",
  "question": "How many days until a date?",
  "summary": "Counts the days from today, or any date you choose, to a date you pick, with its weekday and the same time in weeks and in months.",
  "category": "days",
  "subcategory": "countdowns",
  "url": "https://www.acalculator.org/days/days-until",
  "markdown": "https://www.acalculator.org/days/days-until.md",
  "kind": "function",
  "method": "Days until = the date − the start date, in calendar days.",
  "assumptions": [
    "The start date itself is not counted: from the day before, the count is 1; on the day itself, it is 0.",
    "Dates are calendar days with no time of day, so a time zone or a daylight-saving change never adds or loses a day.",
    "Years, months, and days: the most whole years, then the most whole months, then the days left. A month from a day that the next month does not have ends on that month’s last day (January 31 plus one month is February 28, or 29 in a leap year).",
    "Dates from January 1, 1900 to December 31, 2400 work."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "to": {
        "title": "Count to",
        "description": "The date to count down to. A year from today, unless you change it.",
        "type": "string",
        "format": "date"
      },
      "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 date",
      "description": "Whole days from the start date to the date; 0 when they are the same day.",
      "format": "integer"
    },
    "weekday": {
      "label": "Day of the week",
      "description": "The weekday of the date you count to.",
      "format": "text"
    },
    "weeks": {
      "label": "In weeks",
      "description": "The same number of days in weeks and days.",
      "format": "text"
    },
    "months": {
      "label": "In years, months, and days",
      "description": "The time to the date in whole years, then whole months, then days.",
      "format": "duration"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "to": "2027-09-30",
      "from": "2026-09-30"
    },
    "outputs": {
      "days": 365,
      "weekday": "Thursday",
      "weeks": "52 weeks and 1 day",
      "months": {
        "years": 1,
        "months": 0,
        "days": 0
      }
    },
    "text": "From September 30, 2026, there are 365 days until September 30, 2027."
  },
  "examples": [
    {
      "given": {
        "from": "2026-09-29",
        "to": "2027-01-01"
      },
      "expect": {
        "days": 94,
        "weekday": "Friday",
        "weeks": "13 weeks and 3 days"
      },
      "source": "hand calculation in content.mdx: 1 + 31 + 30 + 31 + 1 = 94 days; Python 3 datetime (WP-45 log)"
    },
    {
      "given": {
        "from": "2028-02-01",
        "to": "2028-03-01"
      },
      "expect": {
        "days": 29,
        "weekday": "Wednesday",
        "months": {
          "years": 0,
          "months": 1,
          "days": 0
        }
      },
      "source": "hand calculation in content.mdx: February 2028 has 29 days; Python 3 datetime (WP-45 log)"
    },
    {
      "given": {
        "from": "2026-03-07",
        "to": "2026-03-09"
      },
      "expect": {
        "days": 2,
        "weekday": "Monday"
      },
      "source": "hand calculation in content.mdx: March 9 − March 7 = 2 days; Python 3 datetime (WP-45 log)"
    },
    {
      "given": {
        "from": "2026-12-25",
        "to": "2026-12-25"
      },
      "expect": {
        "days": 0,
        "weeks": "0 days"
      },
      "source": "hand calculation in content.mdx: the same day counts 0"
    }
  ],
  "sources": [],
  "related": [
    "days-until-christmas",
    "days-until-halloween",
    "days-until-new-year",
    "days-until-thanksgiving",
    "days-between-dates",
    "days-from-today",
    "date"
  ],
  "changelog": []
}
