Day of year to date converter
Day 61 of 2024 is 1 March, because 2024 is a leap year with 366 days. Enter a year and a day number to get the calendar date, whether the year is leap and how many days remain until 31 December. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Year
- 2,024
- Day of year
- 61
- Date
- 2024-03-01
- Month
- 3
- Day
- 1
- Days in year
- 366
A day-of-year ordinal is the position of a calendar day inside its year counting from one on the first of January through three hundred sixty-five or three hundred sixty-six on the thirty-first of December. Many pipelines, science notebooks, and annual trackers store that ordinal instead of a full civil date, then need the reverse map when they report to users, write ISO timestamps, or join against tables keyed by year-month-day. This converter accepts a Gregorian year and a day-of-year integer, applies the civil leap-year rule so February twenty-nine exists only in leap years, and returns the matching calendar date together with month and day components, a leap flag, the length of the year, and how many days remain until December thirty-first. Ordinals that fall outside the legal range for that year—for example day three hundred sixty-six in a common year—fail with a clear validation error instead of wrapping into the next year or inventing a phantom date.
How a day-of-year ordinal becomes a calendar date
Start with two integers: a Gregorian year in a practical range from one through nine thousand nine hundred ninety-nine, and a day-of-year ordinal that counts from one on January first. First decide whether the year is a leap year under the civil rule used worldwide: a year is leap when it is divisible by four, except that century years are leap only when they are also divisible by four hundred.
That rule makes two thousand twenty-four and two thousand leap years with three hundred sixty-six days, while two thousand twenty-three and nineteen hundred are common years with three hundred sixty-five days. With year length known, reject any ordinal less than one or greater than the year length so that day three hundred sixty-six never appears in a common year and day zero is never accepted.
When the ordinal is legal, walk the twelve month lengths for that year, subtracting each complete month until the remaining count fits inside the next month; the month index and residual day are the civil month and day-of-month. Format those three components as a strict ISO string with four-digit year and two-digit month and day so every client sees the same date text.
Classic checks include ordinal one mapping to January first, ordinal sixty-one mapping to March first in a leap year and March second in a common year when you compare against the reverse calculator, and the final ordinal mapping to December thirty-first.
Where day-of-year to date conversion shows up in real work
Operations teams that stamp batch jobs with day-of-year numbers still need civil dates when they open tickets, write invoices, or present dashboards to non-technical stakeholders. Climate and agriculture notebooks often store multi-year series on a one-to-three-hundred-sixty-six axis and later materialize March-first or harvest-window dates for reports that stakeholders read as year-month-day. Project managers tracking annual objectives from a progress fraction convert day number back to a calendar date when they schedule reviews.
Software that must stay free of time-zone libraries still needs a pure reverse map from ordinal to ISO for compliance calendars defined by civil dates rather than Unix epochs. If you later need business-day counts between two dates, age from a birth date, full Julian day numbers, or week-of-year numbering under ISO eight thousand six hundred one, treat those as separate search intents and landings rather than overloading this day-of-year-to-date converter page.
What you can do with it
Ordinal series to civil reports
Convert stored day-of-year labels into ISO YYYY-MM-DD for dashboards, invoices, and stakeholder reports that require civil calendar dates.
Science and seasonal materialization
Map 1–366 research axes back to March-first or harvest dates with correct leap-year February lengths.
FAQ
Does it handle leap years?
Yes. Gregorian leap rules apply: divisible by 4, except centuries must be divisible by 400. Day 366 is accepted only in leap years and February has 29 days when mapping mid-year ordinals.
Is this the same as day of the year calculator?
No. That tool turns an ISO date into an ordinal. This converter is the reverse: year plus ordinal into a calendar date. Different search intent and different slug.
What does it cost?
The browser tool is free and runs locally.
What happens if I enter day 366 in a common year?
It is rejected with a message that gives the year length, for example 365 days for 2023. The day never rolls over into the next year, and day 0 is never accepted.
How do I know how many days are left in the year?
The result shows the days remaining until 31 December next to the date. Day 61 of 2024, for instance, leaves 305 days before the year ends.
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/date-from-dayofyear \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"year":2024,"day_of_year":61}'const res = await fetch("https://api.kit.forhosting.com/date/date-from-dayofyear", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"year": 2024,
"day_of_year": 61
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/date-from-dayofyear",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"year": 2024,
"day_of_year": 61
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/date-from-dayofyear", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"year":2024,"day_of_year":61}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"year":2024,"day_of_year":61}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/date-from-dayofyear", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"year": 2024,
"day_of_year": 61
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.date_from_dayofyear",
"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.
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 you send and what you get back
Ordinals that are integers but exceed the number of days in that year, such as three hundred sixty-six in two thousand twenty-three, also fail with a message that names the year length so clients can correct the input without guessing. If you already have an ISO date and need the ordinal instead, use the separate day-of-the-year calculator landing rather than overloading this reverse converter. Send two required numeric fields: year as an integer from one to nine thousand nine hundred ninety-nine, and day_of_year as an integer from one through three hundred sixty-five or three hundred sixty-six depending on leap status. Missing fields, non-numeric strings, NaN, Infinity, and fractional values fail with invalid_input and are not charged. On success the response echoes year and day_of_year, returns date as a normalized ISO calendar string, numeric month and day components, a boolean is_leap_year flag, days_in_year as three hundred sixty-five or three hundred sixty-six, remaining_days until the last day of that year, and a short formula string that documents the month-walk and leap rule. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where day-of-year to date conversion shows up in real work
Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
Batch partition decoding
Turn warehouse and log partition ordinals into stable ISO dates with clear invalid_input when the ordinal exceeds that year’s length.
Technical questions
What inputs does the day of year to date converter need?
Two integers: year (1–9999) and day_of_year (1 through 365 in a common year or 366 in a leap year). Both fields are required.
What happens if day_of_year is 366 in a common year?
The request fails with invalid_input and is not charged. The error explains that the ordinal exceeds the number of days in that year.