{
  "id": "days-until-summer",
  "version": "99e4951bf40d",
  "status": "published",
  "name": "Days Until Summer",
  "question": "Days until summer",
  "summary": "Counts the days from today, or any date you choose, to the next first day of summer, with its date and day of the week.",
  "category": "days",
  "subcategory": "countdowns",
  "url": "https://www.acalculator.org/days/days-until-summer",
  "markdown": "https://www.acalculator.org/days/days-until-summer.md",
  "kind": "function",
  "method": "Find the first date of the first day of summer on or after the start date, then count the days from the start date to it.",
  "assumptions": [
    "Summer starts at the June solstice (June 20 or 21 in US Eastern Time), when the Sun is farthest north.",
    "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 Summer",
      "description": "Whole days from the start date to the next first day of summer; 0 on the day itself.",
      "format": "integer"
    },
    "date": {
      "label": "Date",
      "description": "The next date of the first day of summer 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": 265,
      "date": "2027-06-21",
      "weekday": "Monday",
      "weeks": "37 weeks and 6 days"
    },
    "text": "From September 29, 2026, there are 265 days until the first day of summer on Monday, June 21, 2027."
  },
  "examples": [
    {
      "given": {
        "from": "2026-01-01"
      },
      "expect": {
        "date": "2026-06-21",
        "days": 171
      },
      "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-06-22"
      },
      "expect": {
        "date": "2027-06-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-fathers-day",
    "days-until-fourth-of-july",
    "days-until-labor-day",
    "days-until-fall",
    "days-until-halloween",
    "days-between-dates"
  ],
  "changelog": []
}
