{
  "id": "days-since",
  "version": "fb66dd77e8b3",
  "status": "published",
  "name": "Days Since Calculator",
  "question": "How many days since a date?",
  "summary": "Counts the calendar days from a past date up to today or another end date, also as weeks and days, as years, months, and days, and as a day number.",
  "category": "days",
  "subcategory": "dates",
  "url": "https://www.acalculator.org/days/days-since-calculator",
  "markdown": "https://www.acalculator.org/days/days-since-calculator.md",
  "kind": "function",
  "method": "days since = end date − start date, in whole calendar days (the start date is not counted, the end date is)",
  "assumptions": [
    "Dates are whole calendar days in the Gregorian calendar, with no time of day, so daylight-saving changes cannot add or lose a day.",
    "The count is the end date minus the start date: from yesterday to today is 1 day, and the same date twice is 0 days.",
    "The end date is today unless you change it; the page reads today’s date from your device when it loads.",
    "A start date after the end date has no answer."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "start": {
        "title": "Start date",
        "description": "The past date to count from.",
        "type": "string",
        "format": "date"
      },
      "end": {
        "title": "Count up to",
        "description": "The date to count up to. Today, unless you change it.",
        "type": "string",
        "format": "date"
      }
    }
  },
  "outputs": {
    "days": {
      "label": "Days since",
      "description": "Calendar days from the start date up to the end date: the end date minus the start date.",
      "format": "integer"
    },
    "weeks": {
      "label": "In weeks",
      "description": "The days as whole weeks and the days left.",
      "format": "duration"
    },
    "span": {
      "label": "In years, months, and days",
      "description": "The time from the start date to the end date as whole years, then whole months, then days.",
      "format": "duration"
    },
    "dayNumber": {
      "label": "Day number",
      "description": "The end date’s number when the start date is day 1: the days since plus 1.",
      "format": "integer"
    },
    "weekday": {
      "label": "Start date was a",
      "description": "The day of the week of the start date.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "start": "2026-06-22",
      "end": "2026-09-30"
    },
    "outputs": {
      "days": 100,
      "weeks": {
        "weeks": 14,
        "days": 2
      },
      "span": {
        "years": 0,
        "months": 3,
        "days": 8
      },
      "dayNumber": 101,
      "weekday": "Monday"
    },
    "text": "100 days since June 22, 2026."
  },
  "examples": [
    {
      "given": {
        "start": "2026-01-01",
        "end": "2026-09-30"
      },
      "expect": {
        "days": 272,
        "weeks": {
          "weeks": 38,
          "days": 6
        },
        "span": {
          "years": 0,
          "months": 8,
          "days": 29
        },
        "dayNumber": 273,
        "weekday": "Thursday"
      },
      "source": "Julian Day numbers (Meeus, Astronomical Algorithms, 1991, chapter 7): JD 2461313.5 − JD 2461041.5 = 272; hand calculation in content.mdx; Python: (date(2026,9,30) - date(2026,1,1)).days = 272"
    },
    {
      "given": {
        "start": "2024-02-28",
        "end": "2024-03-01"
      },
      "expect": {
        "days": 2,
        "dayNumber": 3,
        "weekday": "Wednesday"
      },
      "source": "Gregorian leap-year rule (ISO 8601); hand calculation in content.mdx"
    },
    {
      "given": {
        "start": "2000-01-01",
        "end": "2026-09-30"
      },
      "expect": {
        "days": 9769,
        "span": {
          "years": 26,
          "months": 8,
          "days": 29
        },
        "weekday": "Saturday"
      },
      "source": "Julian Day numbers (Meeus, Astronomical Algorithms, 1991, chapter 7): JD 2461313.5 − JD 2451544.5 = 9769; Python: (date(2026,9,30) - date(2000,1,1)).days = 9769"
    },
    {
      "given": {
        "start": "2026-09-30",
        "end": "2026-09-30"
      },
      "expect": {
        "days": 0,
        "weeks": {
          "weeks": 0,
          "days": 0
        },
        "dayNumber": 1
      },
      "source": "hand calculation in content.mdx: the same date is 0 days, day 1"
    }
  ],
  "sources": [
    "Jean Meeus, Astronomical Algorithms (1991), chapter 7: Julian Day numbers, so the days between two dates are the difference of their Julian Days.",
    "ISO 8601, Date and time format: the Gregorian calendar and its leap-year rule."
  ],
  "related": [
    "days-between-dates",
    "days-from-today",
    "date",
    "weeks"
  ],
  "changelog": []
}
