Days elapsed in the year
By 15 March 2024, 74 whole days of the year have passed, which makes it day 75 of a leap year. Enter a date to see how many days have gone by since 1 January, with 1 January itself counting as zero. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Date
- 2024-03-15
- Year
- 2,024
- Month
- 3
- Day
- 15
- Day of year
- 75
This days-elapsed-in-the-year calculator takes one Gregorian calendar date in strict YYYY-MM-DD form and returns how many whole days have already passed since January 1 of that same year. Classic checks include 2024-01-01 yielding zero days elapsed, 2024-03-15 yielding seventy-four days in a leap year, and 2023-12-31 yielding three hundred sixty-four days in a common year. The engine uses only deterministic proleptic Gregorian arithmetic: it validates that the day actually exists on the calendar, sums the lengths of the months before the given month, adds the day-of-month, then subtracts one so January 1 is zero rather than one.
What days elapsed means and what you get
Days elapsed since January 1 answers a different question from the ordinal day-of-year people sometimes print as one through three hundred sixty-six, from whole-day distance between two arbitrary dates, and from business-day or age calculators. Here the clock of the year starts at zero on January 1: by March 15 in a leap year seventy-four whole days have already finished, and the calendar day itself is day number seventy-five of the year.
If you need distance between two dates, ISO week numbers, subtract-days navigation, or multi-format parsing, use those dedicated tools; this page answers only how many whole days have passed since January 1 of the year that contains the given date.
Where year-progress arithmetic fits in planning, reporting, and software
Operations and product teams measure days elapsed in the year when a dashboard shows year-to-date progress, when a policy refers to the Nth calendar day after New Year, or when a retention or reporting window is defined relative to January 1 rather than to a live clock. Analysts building annual cohorts use the same number to label observation positions inside a year without off-by-one errors at month ends and leap days that appear when people subtract spreadsheet serial numbers by hand.
Educators and standards writers use the tool to demonstrate that 2024-02-29 is day sixty of a leap year while the same February length does not exist in 2023, without relying on opaque calculator apps that silently include times of day. Pair it with days-between, ISO week helpers, or epoch conversion when you need related calendar steps, and with other free deterministic tools when you are assembling a small lab of date utilities.
What you can do with it
Year-to-date progress displays
Show how many whole calendar days have passed since January 1 for dashboards, OKR timelines, and annual progress bars without timezone drift.
Leap-year day-of-year checks
Verify ordinal and elapsed positions that cross February 29 only in leap years, including December 31 at 364 or 365 days elapsed.
FAQ
What does the days-elapsed-in-the-year calculator cost?
It is free in your browser on this page.
Is this the same as days between two dates?
No. This tool only measures distance from January 1 of the same year. For an arbitrary pair of dates, use the days-between calculator.
Are times of day or time zones included?
No. This tool counts pure Gregorian calendar days only. It does not parse times, offsets, or the host clock.
Why does 1 January count as zero?
Because the count shows completed days, and on 1 January none has finished yet. The date's own day number is always one higher: on 31 December 2023, 364 days have passed.
How does a leap year change the count?
From 29 February onward every date is one day further along, because that extra day only exists in leap years. In 2024, 29 February itself is day 60 of the year.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/date/days-elapsed-year \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2024-03-15"}'const res = await fetch("https://api.kit.forhosting.com/date/days-elapsed-year", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"date": "2024-03-15"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/days-elapsed-year",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"date": "2024-03-15"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/days-elapsed-year", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"date":"2024-03-15"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"date":"2024-03-15"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/days-elapsed-year", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"date": "2024-03-15"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.days_elapsed_year",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
year_min | 1 |
year_max | 9999 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What days elapsed means and what the response contains
You supply a single date as a strict YYYY-MM-DD string; the calculator validates that the day is a real Gregorian calendar day — February 29 only in leap years, thirty days in April, never day thirty-two — then returns the normalized date string, year, month, and day components, day_of_year as the one-based ordinal, days_elapsed as day_of_year minus one, is_leap as a boolean, days_in_year as three hundred sixty-five or three hundred sixty-six, and a short formula reminder. Rejected cases include a missing date field, wrong shapes such as 2024/03/15, impossible months, days that do not exist such as 2023-02-29, and years outside one through 9999.
How the date is read and how the count stays reproducible
The string must match four digits, a hyphen, two digits, another hyphen, and two digits; leading or trailing spaces are trimmed, but partial dates, ordinal day-of-year alone, month names, and embedded times are not expanded here. After parsing, the year must fall between 1 and 9999, the month between 1 and 12, and the day between 1 and the true length of that month in that year, with leap years following the Gregorian rule of divisible by four except century years not divisible by four hundred. The preferred field is date, but aliases iso_date, d, value, and day are accepted so spreadsheets, query strings, and typed forms can reuse the same contract without renaming columns. Internally the engine sums days in each complete month before the given month, adds the day-of-month to obtain day_of_year, then sets days_elapsed to day_of_year minus one — pure integer arithmetic that is bitwise stable across runtimes. January 1 always yields zero elapsed and day_of_year one; December 31 yields three hundred sixty-four elapsed in a common year and three hundred sixty-five in a leap year. Pair the free browser run on this page with the priced API when you need the identical elapsed-day number inside an automated pipeline.
Where year-progress arithmetic fits in planning, reporting, and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a one-off check to a pipeline without changing the mathematical result.
Integration use cases
Deterministic test fixtures
Generate reproducible days_elapsed and day_of_year numbers for unit tests, property checks, and CI assertions without depending on Date.
Technical questions
How is days_elapsed defined?
days_elapsed is day_of_year minus one. January 1 yields 0; January 2 yields 1. day_of_year is the one-based ordinal (1 on January 1).
What happens with leap years and invalid dates?
Month lengths and leap days are validated. For example, 2024-02-29 is accepted, while 2023-02-29 is rejected with invalid_input.