Endpoints
The API has two read-only endpoints. Both accept GET, answer in JSON and allow cross-origin requests from any site, so you can call them from browser code as well as from a server.
https://epochtime.tools/api/v1/convert.phpconverts a Unix timestamp or an ISO 8601 date.https://epochtime.tools/api/v1/now.phpreturns the current time in the same shape.
Parameters
input(convert only, required): a Unix timestamp or an ISO 8601 date. Timestamps are read as seconds, milliseconds, microseconds or nanoseconds by digit count, up to 11, 13, 16 and more digits. Fractional seconds are accepted. An ISO 8601 date with no offset is read in the time zone you pass.tz(optional): an IANA time zone such asAsia/Kolkata. The default is UTC.pretty=1(convert only, optional): indents the JSON.
The supported range is the year 0001 to the year 9999.
Examples
curl "https://epochtime.tools/api/v1/convert.php?input=1700000000&tz=America/New_York"curl "https://epochtime.tools/api/v1/now.php?tz=Asia/Kolkata"const r = await fetch("https://epochtime.tools/api/v1/convert.php?input=" + encodeURIComponent("2026-11-17 09:30") + "&tz=Europe/London");
const data = await r.json();
console.log(data.unix.seconds);import requests
r = requests.get("https://epochtime.tools/api/v1/convert.php",
params={"input": "1700000000000", "tz": "UTC"}, timeout=10)
print(r.json()["utc"]["iso8601"])
Response
Epoch values are strings, so nanosecond values do not lose precision in languages that parse JSON numbers as floating point.
{
"ok": true,
"input": "1700000000",
"detected": "unix seconds",
"unix": { "seconds": "1700000000", "milliseconds": "1700000000000",
"microseconds": "1700000000000000", "nanoseconds": "1700000000000000000" },
"utc": { "iso8601": "2023-11-14T22:13:20.000Z",
"rfc2822": "Tue, 14 Nov 2023 22:13:20 +0000", "weekday": "Tuesday" },
"local": { "timezone": "America/New_York", "iso8601": "2023-11-14T17:13:20.000-05:00",
"utc_offset": "-05:00", "weekday": "Tuesday" }
}
Errors
A failure returns "ok": false, a short code and a message, with a matching HTTP status. The codes are missing_input, empty_input, input_too_long, invalid_date, invalid_offset, out_of_range, unparseable, invalid_timezone, method_not_allowed and rate_limited.
Limits and caching
Each IP address can make 120 requests a minute. Beyond that the API answers 429 with a Retry-After header. Conversions are cacheable for an hour. The current-time endpoint is never cached. There is no key and no sign-up. If you need more, convert in your own code: the logic is small, and the language guides show how.
Privacy
Unlike the converter pages, which run entirely in your browser, the API has to receive what you send. It does not log requests or store the input. To enforce the rate limit it keeps a per-minute counter keyed by a hash of your IP address and the date, in the server's temporary folder, and deletes those files after ten minutes. Do not send anything you consider sensitive. For that, use the command line tool or the converter, which never send data anywhere.
Questions
Do I need an API key?
No. The API is free and needs no key or sign-up. It is limited to 120 requests a minute per IP address.
Why are the epoch values strings?
Nanosecond timestamps are larger than the largest integer a JSON number can hold exactly in JavaScript and many other languages. Strings keep every digit.
Does the API log what I send?
No. It stores nothing from the request. It keeps only a short-lived request counter keyed by a hash of your IP address, to apply the rate limit.
Can I call it from a web page?
Yes. The API sends CORS headers that allow any origin, so fetch calls from the browser work.
Is there an uptime guarantee?
No. It is a free service with no service-level agreement. Build in a fallback, or convert locally with the command line tool.
Need to check the JSON you get back? jsontools.tools formats and validates it.