{
  "id": "days-until-winter",
  "version": "d1f56a7955fe",
  "status": "published",
  "name": "Days Until Winter",
  "question": "Days until winter",
  "summary": "Counts the days from today, or any date you choose, to the next first day of winter, with its date and day of the week.",
  "category": "days",
  "subcategory": "countdowns",
  "url": "https://www.acalculator.org/days/days-until-winter",
  "markdown": "https://www.acalculator.org/days/days-until-winter.md",
  "kind": "function",
  "method": "Find the first date of the first day of winter on or after the start date, then count the days from the start date to it.",
  "assumptions": [
    "Winter starts at the December solstice (December 20, 21, or 22 in US Eastern Time), when the Sun is farthest south.",
    "Start dates from January 1, 2007 to December 31, 2060 work, because the dates are checked against the US Naval Observatory for these years, and US daylight time has started in March since 2007.",
    "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."
  ],
  "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 Winter",
      "description": "Whole days from the start date to the next first day of winter; 0 on the day itself.",
      "format": "integer"
    },
    "date": {
      "label": "Date",
      "description": "The next date of the first day of winter on or after the start date.",
      "format": "date-long"
    },
    "weekday": {
      "label": "Day of the week",
      "description": "The weekday of that date.",
      "format": "text"
    },
    "weeks": {
      "label": "In weeks",
      "description": "The same number of days in weeks and days.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "from": "2026-09-29"
    },
    "outputs": {
      "days": 83,
      "date": "2026-12-21",
      "weekday": "Monday",
      "weeks": "11 weeks and 6 days"
    },
    "text": "From September 29, 2026, there are 83 days until the first day of winter on Monday, December 21, 2026."
  },
  "examples": [
    {
      "given": {
        "from": "2026-01-01"
      },
      "expect": {
        "date": "2026-12-21",
        "days": 354
      },
      "source": "US Naval Observatory seasons API (https://aa.usno.navy.mil/api/seasons), converted to US Eastern Time; Meeus, Astronomical Algorithms, ch. 27"
    },
    {
      "given": {
        "from": "2026-12-22"
      },
      "expect": {
        "date": "2027-12-21",
        "days": 364
      },
      "source": "US Naval Observatory seasons API (https://aa.usno.navy.mil/api/seasons), converted to US Eastern Time; Meeus, Astronomical Algorithms, ch. 27"
    }
  ],
  "sources": [
    "US Naval Observatory seasons API (https://aa.usno.navy.mil/api/seasons), converted to US Eastern Time; Meeus, Astronomical Algorithms, ch. 27"
  ],
  "related": [
    "days-until-christmas-eve",
    "days-until-christmas",
    "days-until-new-years-eve",
    "days-until-new-year",
    "days-until-groundhog-day",
    "days-between-dates"
  ],
  "changelog": []
}
