A complete, human-friendly guide to converting epoch (Unix) timestamps into readable dates and times. Learn how to use ZenixTools, avoid common pitfalls, and convert in code, CLI, spreadsheets, and databases.
If you work with logs, APIs, or databases, you meet epoch time a lot. An epoch to time converter lets you turn Unix timestamps (seconds or milliseconds since 1970-01-01 UTC) into readable dates. This guide shows how to convert timestamps fast with ZenixTools, avoid common mistakes, and get results you can trust.
To convert epoch to time, paste your Unix timestamp into a converter, choose seconds or milliseconds, pick a timezone (UTC or local), and hit convert. You’ll get a human-readable date like 2021-01-01 00:00:00 UTC. For code, use built-ins: new Date(epoch * 1000) in JS for seconds, or new Date(ms) for milliseconds. Always confirm units and timezone.
This guide explains epoch (Unix) timestamps and how to convert them into readable dates. You’ll learn the difference between seconds and milliseconds, UTC vs local time, and how to avoid DST and Year 2038 issues. It includes step-by-step instructions for ZenixTools, code snippets for JavaScript and Python, SQL and CLI examples, best practices, and a comparison of methods. Perfect for developers, data analysts, SREs, and students working with logs, APIs, JWTs, and CSVs.
An epoch to time converter transforms a Unix timestamp into a human-readable date and time.
In short, the tool decodes raw numeric timestamps into clear dates for people and machines.
You will find epoch timestamps almost everywhere:
Converting epoch to readable time helps you debug faster, audit events, align teams across timezones, and present clear timelines.
Note: If your result looks far in the past or future, you likely mixed seconds and milliseconds.
Seconds to date (UTC):
// epoch in seconds
const epoch = 1609459200; // 2021-01-01 00:00:00 UTC
const dateUtc = new Date(epoch * 1000);
console.log(dateUtc.toISOString()); // 2021-01-01T00:00:00.000Z
Milliseconds to date:
const ms = 1609459200000;
const dateUtc = new Date(ms);
console.log(dateUtc.toISOString());
Local time formatting:
const d = new Date(1609459200000);
console.log(d.toLocaleString());
Advanced formatting with Intl:
const d = new Date(1609459200000);
const fmt = new Intl.DateTimeFormat('en-US', {
timeZone: 'America/New_York',
year: 'numeric', month: '2-digit', day: '2-digit',
hour: '2-digit', minute: '2-digit', second: '2-digit'
});
console.log(fmt.format(d));
Seconds to date (UTC):
import datetime as dt
epoch = 1609459200
print(dt.datetime.utcfromtimestamp(epoch).isoformat() + 'Z')
Milliseconds to date (UTC):
ms = 1609459200000
print(dt.datetime.utcfromtimestamp(ms/1000).isoformat() + 'Z')
Timezone with zoneinfo (Python 3.9+):
from zoneinfo import ZoneInfo
from datetime import datetime
epoch = 1609459200
local = datetime.fromtimestamp(epoch, tz=ZoneInfo('America/New_York'))
print(local.isoformat())
Bash (GNU date):
# seconds
date -ud @1609459200
# milliseconds
date -ud @$(echo '1609459200000/1000' | bc)
macOS (BSD date) may use slightly different flags:
# seconds
date -ur 1609459200
PostgreSQL:
-- seconds -> timestamptz UTC
to_timestamp(1609459200) AT TIME ZONE 'UTC';
-- milliseconds
to_timestamp(1609459200000 / 1000.0) AT TIME ZONE 'UTC';
MySQL 8+
-- seconds
from_unixtime(1609459200);
-- milliseconds
from_unixtime(1609459200000 / 1000);
SQLite (with unixepoch):
-- seconds
select datetime(1609459200, 'unixepoch');
-- milliseconds
select datetime(1609459200000 / 1000, 'unixepoch');
Google Sheets / Excel:
Warning: Spreadsheets default to local time; confirm your timezone settings.
Example walkthrough (JavaScript):
const epoch = 1711920000;
const iso = new Date(epoch * 1000).toISOString();
// Result: 2024-04-01T00:00:00.000Z
Example walkthrough (Python):
epoch = 1697040000
from datetime import datetime
d = datetime.utcfromtimestamp(epoch).isoformat() + 'Z'
# '2023-10-11T00:00:00Z'
Example (PostgreSQL):
select to_timestamp(1697040000) at time zone 'UTC';
-- 2023-10-11 00:00:00+00
| Method/Tool | Ideal For | Pros | Cons | Example |
|---|---|---|---|---|
| ZenixTools Converter | Quick checks, teams | Fast, timezone support, batch, copy | Requires internet | Paste epoch, get ISO |
| CLI (date) | Shell users, scripts | No UI needed, easy automation | Flags differ across OS | date -ud @1609459200 |
| JavaScript/Python | Apps, services | Full control, reproducible, testable | More code to write | new Date(ms) |
| SQL functions | DB analytics, ETL | Close to data, performant | Dialect differences | to_timestamp(x) |
| Spreadsheets | Non-dev analysis | Visual, shareable | Timezone defaults, precision limits | =A2/86400 + DATE(1970,1,1) |
What is epoch time? Epoch time is a count of seconds since 1970-01-01 00:00:00 UTC. It is also called Unix time or POSIX time.
How do I use an epoch to time converter? Paste your timestamp, pick seconds or milliseconds, choose a timezone (usually UTC), and convert. You’ll get a readable date like 2024-04-01T00:00:00Z.
Is my timestamp in seconds or milliseconds? 10 digits usually means seconds. 13 digits usually means milliseconds. Check docs and test a known date to confirm.
Why does my result show 1970? You likely treated milliseconds as seconds. Divide by 1000 and try again.
What is the difference between UTC and local time? UTC is a global baseline with no daylight saving. Local time adds a region’s offset and DST rules. Store in UTC, display in local.
Does epoch time handle leap seconds? Most systems ignore leap seconds. They use a continuous second count. Rely on standard libraries, not manual adjustments.
What about the Year 2038 problem? On 32-bit systems using signed 32-bit time, timestamps after 2038-01-19 overflow. Use 64-bit types and modern OS/runtime.
How do I convert epoch to ISO 8601 in JavaScript? Create a Date from milliseconds, then call toISOString. For seconds, multiply by 1000 first.
How can I convert in Python? Use datetime.utcfromtimestamp for UTC. For milliseconds, divide by 1000. Use zoneinfo for specific timezones.
Can I convert multiple timestamps at once? Yes. ZenixTools supports batch input. Many languages and CLIs also handle lists or files.
How do I handle timezones like America/New_York? Compute in UTC, then format using a timezone-aware library (Intl in JS, zoneinfo in Python) for display.
Is ISO 8601 the same as RFC 3339? RFC 3339 is a profile of ISO 8601 used on the web. It is strict and predictable. Format like 2024-04-01T00:00:00Z.
Epoch time is simple, but details matter. Use UTC, confirm seconds or milliseconds, and prefer ISO 8601 for clarity. With ZenixTools you can convert timestamps fast, share clean results, and avoid common pitfalls like DST or unit mistakes. Keep this guide handy for logs, APIs, databases, and more.
Convert your next timestamp in seconds. Try the ZenixTools epoch to time converter now, switch timezones, and copy clean ISO results for your logs, tickets, and dashboards. Save time, reduce errors, and standardize your date handling across teams.
A complete, human-friendly guide to convert to WebP for faster sites and better SEO. Learn benefits, step-by-step workflows, code examples, and expert tips. Use ZenixTools to convert to WebP in seconds.
A practical, expert guide to convert base64 to string across languages, with steps, examples, pitfalls, and best practices.
Why does my spreadsheet show the wrong time? Sheets and Excel default to local time and sometimes local locale. Set the file timezone or adjust with offsets.
How do I convert in SQL? PostgreSQL: to_timestamp(seconds). MySQL: from_unixtime(seconds). For milliseconds, divide by 1000. Use timestamptz for timezone-aware types.
Can an epoch to time converter work offline? The ZenixTools web tool is online, but you can convert offline with CLI tools or code (JS, Python, SQL).