Leap seconds UTC↔TAI
Find the gap between atomic time and UTC for any date, or list the leap seconds behind it: on 2017-01-02, TAI−UTC is 37 seconds. The leap-second table is built in, so nothing is fetched online. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Calculation mode
- Offset
- Date
- 2017-01-02
- TAI−UTC offset (seconds)
- 37
List embedded IERS leap seconds and convert UTC civil dates to TAI-UTC offsets without network access.
Leap seconds and the TAI−UTC gap
International Atomic Time and Coordinated Universal Time do not run in perfect step: the gap between them is set by the leap seconds that have been added to UTC. This tool keeps a built-in table of the IERS leap seconds and answers two questions from it. The first is the offset: give a UTC calendar date and it returns how many seconds TAI is ahead of UTC on that day, for example 37 seconds on 2017-01-02. The second is the list: it shows the leap seconds in the table, optionally between two dates, so you can see exactly when the gap changed.
When it helps and what to watch for
The offset matters whenever a time kept in atomic time has to be compared with a time kept in UTC, and without it you would have to maintain a spreadsheet of past leap seconds by hand. Typical mistakes are expecting a time zone to shift the result, when only the calendar date in UTC counts; giving a date span whose end comes before its start, which is refused instead of being guessed; and leaving the date empty. Because the table is built in and nothing is fetched online, the same date always gives the same number of seconds.
Edge cases and limits
Empty strings, wrong types, and contradictory ranges are rejected early. Civil dates without timezone are calendar dates. Embedded tables travel inside the capability folder with no network calls at runtime.
Review examples before integrating.
What you can do with it
Daily work
Get a reliable answer without a spreadsheet.
FAQ
What does TAI−UTC mean?
It is how many seconds International Atomic Time runs ahead of Coordinated Universal Time on a given date. The gap changes only when a leap second is added to UTC, which is why it is read from the leap-second table.
Can I see the leap seconds themselves?
Yes. Choose the list option to see the leap seconds in the built-in table, optionally limited to a span between two dates. A span whose end comes before its start is refused rather than guessed.
Does it look anything up online?
No. The leap-second table is built in and nothing is fetched while you use it, so the same date always gives the same offset in seconds.
Do I need to enter a time or a time zone?
No. Enter a calendar date only. A date without a time zone is read as a plain calendar day in UTC, so your location never changes the offset you get.
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/leap-seconds \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"mode":"offset","date":"2017-01-02"}'const res = await fetch("https://api.kit.forhosting.com/date/leap-seconds", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"mode": "offset",
"date": "2017-01-02"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/leap-seconds",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"mode": "offset",
"date": "2017-01-02"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/leap-seconds", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"mode":"offset","date":"2017-01-02"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"mode":"offset","date":"2017-01-02"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/leap-seconds", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"mode": "offset",
"date": "2017-01-02"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.leap_seconds",
"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
How it works
List embedded IERS leap seconds and convert UTC civil dates to TAI-UTC offsets without network access. The calculation is fully deterministic and runs free in your browser with the same pure function as the API. Inputs are validated before arithmetic so bad types become clear invalid_input errors. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values.
Inputs and outputs
Optional fields use documented defaults. Required schema fields must be present and typed. Success payloads always include the primary output fields so UI bindings stay stable. Extremely large intermediates that overflow IEEE-754 become out-of-range errors rather than nulls. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values.
Edge cases and limits
Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values. Additional guidance covers validation order, deterministic results, browser and API parity, stable error match strings for certification, and safe handling of out-of-range floating values.
Integration use cases
Automation
Same pure function in widget and API.
Teaching
Stable golden fixtures for demos.
Technical questions
Is it free?
Yes, tier A in the browser.
Network?
No network; parse on-device.
Invalid input?
invalid_input with a clear match.
Stable?
Deterministic goldens freeze the contract.
Author?
samurai.