Day fraction to clock time
0.75 of a day is 18:00:00, and 0.5213541666666667 is 12:30:45. Enter a fraction from 0 to 1 and get the clock time in hours, minutes and seconds, rounded to the nearest second over a fixed 86,400-second day. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Day fraction
- 0.5213541667
- Hours
- 12
- Minutes
- 30
- Seconds
- 45
- Total seconds
- 45,045
The day fraction to clock time converter turns a decimal position within a day into readable hours, minutes, and seconds. Enter a value from zero through one, such as 0.5 for noon or 0.75 for 18:00:00, and receive both separated clock fields and a formatted time. The calculation uses a fixed 86,400-second day and rounds to the nearest whole second.
What a fraction of a day means
A day fraction describes how far a point lies through one complete 24-hour day. Zero is the start at 00:00:00, one half is twelve hours later at 12:00:00, and three quarters is 18:00:00. The value one is accepted as the exact end boundary and is returned as 24:00:00, which distinguishes it from the start of the interval even though both boundaries can refer to adjoining midnights in calendar notation.
This representation commonly appears in spreadsheets, scientific tables, scheduling exports, and systems that store a time as the fractional portion of a serial date. The converter treats the number only as a position in a fixed-length day. It does not infer a date, timezone, locale, or daylight-saving transition.
Consequently, a real civil day that loses or gains an hour is outside this calculation: the arithmetic day here always contains exactly 24 hours, 1,440 minutes, and 86,400 seconds. Use a date-aware timezone tool when those calendar rules matter.
How the converter calculates and rounds the time
The algorithm multiplies the supplied fraction by 86,400 to obtain seconds from the start of the day, then rounds that quantity to the nearest whole second. It divides the rounded total by 3,600 for hours, uses the remainder to find minutes, and leaves the final remainder as seconds. For example, 0.5213541666666667 represents 45,045 seconds, which becomes 12 hours, 30 minutes, and 45 seconds.
Rounding is necessary because many decimal fractions cannot represent an exact whole second in binary floating-point arithmetic. A value precisely halfway between two seconds follows JavaScript's deterministic Math.round behavior, choosing the next second toward positive infinity. Rounding can also carry across a minute or hour boundary, and a value very close to one may therefore become 24:00:00.
Inputs must be finite numeric values between 0 and 1 inclusive.
What you can do with it
Decode spreadsheet time fractions
Turn a fractional time value exported from a spreadsheet into a readable clock string and separate time fields.
Normalize scientific observations
Convert a normalized position within a fixed 24-hour day into whole seconds for tables, plots, or test data.
FAQ
What formula converts a day fraction to time?
Multiply the fraction by 86,400, round to the nearest whole second, then divide the total into hours, minutes, and seconds.
What time does 0.5 represent?
A day fraction of 0.5 represents 12:00:00 because it is exactly halfway through a 24-hour day.
Why can the result be 24:00:00?
The accepted range includes 1, the exact end of the day.
Does this account for timezones or daylight saving time?
No. It always uses an abstract day of exactly 86,400 seconds and has no date or timezone context.
How do I convert a spreadsheet time that also carries a date?
Enter only the part after the decimal point. Values above 1 are rejected instead of quietly dropping the date part, so a full serial date has to be split before you convert it.
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/day-fraction-to-time \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"day_fraction":0.5213541666666667}'const res = await fetch("https://api.kit.forhosting.com/date/day-fraction-to-time", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"day_fraction": 0.5213541666666667
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/day-fraction-to-time",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"day_fraction": 0.5213541666666667
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/day-fraction-to-time", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"day_fraction":0.5213541666666667}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"day_fraction":0.5213541666666667}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/day-fraction-to-time", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"day_fraction": 0.5213541666666667
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.day_fraction_to_time",
"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
It does not consult a calendar, timezone, daylight-saving rule, network service, or system clock, so the same input always produces the same result in the browser and through the API.
How the converter calculates and rounds the time
Ordinary numeric strings are accepted for form clients, while blank values, booleans, NaN, infinity, and out-of-range numbers produce an invalid_input error rather than a misleading conversion.
Using the output in spreadsheets and software
When importing spreadsheet serial values, pass only the fractional portion if the source number also contains a whole-number date component; this capability intentionally rejects values above one instead of silently discarding their date portion. Some receiving systems accept that ISO-style end-of-day notation, while others require 00:00:00 on the following date. Handle that rollover with the associated date in your application rather than changing the fraction here. The result provides hours, minutes, seconds, total_seconds, and a zero-padded clock_time string, so callers can choose the representation that fits their next step. Display clock_time directly in a report, use the individual integer fields to populate a structured record, or compare total_seconds when sorting and validating data. The original accepted day_fraction is also returned, making an automated conversion easy to audit. Remember that 24:00:00 is possible only for the inclusive endpoint or for a value that rounds to the last boundary. Each successful API conversion costs $0.002, and browser execution uses the same pure calculation without sending the value to a clock or timezone service.
Integration use cases
Build deterministic fixtures
Generate stable expected clock components for software that imports day fractions from another system.
Technical questions
How much does an API conversion cost?
Each successful API request costs $0.002. The browser calculator is free to run.