Learn how to convert epoch to time in seconds, milliseconds, and microseconds using online tools, programming languages, SQL, spreadsheets, and the command line. Avoid timezone and DST mistakes, follow best practices, and see real-world examples. Includes a fast, free converter from ZenixTools.
Epoch time (also called Unix time) is the number of seconds since January 1, 1970 (UTC). It shows up in logs, APIs, databases, and IoT data. If you work with timestamps, you often need to convert epoch to time you can read and share. This guide shows fast, reliable ways to do it.
Featured Snippet (50–70 words)
To convert epoch to time, first confirm the unit (seconds, milliseconds, or microseconds). For seconds, multiply by 1000, then format a date. Example: 1700000000 → UTC 2023-11-14 22:13:20. Linux:
date -u -d @1700000000. macOS:date -u -r 1700000000. JavaScript:new Date(1700000000 * 1000).toISOString(). Always choose a timezone (UTC vs local) to avoid confusion and DST issues.
Need to convert epoch to time fast? Identify the unit (seconds, milliseconds, or microseconds), then format it in your favorite tool. Use ZenixTools’ free converter, or do it in JavaScript (new Date(epoch * 1000)), Python (datetime.fromtimestamp()), SQL (FROM_UNIXTIME / to_timestamp), Excel/Sheets, or the CLI (date). Always standardize on UTC for storage, and handle local time only when displaying. Watch for common errors: seconds vs milliseconds, timezone/DST shifts, 32/64‑bit limits, and locale formatting. Follow best practices: store UTC, use ISO 8601/RFC 3339, record units, and validate ranges.
Date, Python datetime, SQL FROM_UNIXTIME/to_timestamp, CLI date.2023-11-14T22:13:20Z) for portable, sortable timestamps."Convert epoch to time" means turning a numeric Unix timestamp (seconds since 1970-01-01 UTC) into a human-readable date and time. The raw value might be in seconds, milliseconds, or microseconds. The goal is to transform that number into something like 2023-11-14 22:13:20 UTC or a local time format suitable for users and reports.
Notes:
Time powers everything: logs, analytics, security audits, billing, and alerts. If you can quickly convert epoch to time, you can:
For teams, a shared method reduces confusion and makes audits, compliance checks, and root-cause analysis smoother.
If you just need a quick answer:
date -u -d @1700000000date -u -r 1700000000new Date(1700000000 * 1000).toISOString()datetime.fromtimestamp(1700000000, tz=timezone.utc).isoformat()1700000000).1700000000000).1700000000000000).Tip: If you display seconds where milliseconds are expected, times will look ~11.5 days early. If you pass milliseconds to a seconds API, dates may jump far in the future.
Warning: Daylight Saving Time can shift local clocks by an hour. Always specify the zone, e.g., America/New_York.
// Seconds → Date
const epochSec = 1700000000;
const dUtc = new Date(epochSec * 1000);
console.log(dUtc.toISOString()); // 2023-11-14T22:13:20.000Z
// Milliseconds → Date
const epochMs = 1700000000000;
console.log(new Date(epochMs).toISOString());
// Format in a specific timezone (Intl API)
const opts = { timeZone: 'America/New_York', hour12: false };
console.log(new Intl.DateTimeFormat('en-CA', {
...opts, year: 'numeric', month: '2-digit', day: '2-digit',
hour: '2-digit', minute: '2-digit', second: '2-digit'
}).format(dUtc));
from datetime import datetime, timezone
# Seconds → UTC
print(datetime.fromtimestamp(1700000000, tz=timezone.utc).isoformat())
# Milliseconds → UTC
print(datetime.fromtimestamp(1700000000000 / 1000, tz=timezone.utc).isoformat())
# Local timezone example (requires zoneinfo, Python 3.9+)
from zoneinfo import ZoneInfo
ny = ZoneInfo('America/New_York')
print(datetime.fromtimestamp(1700000000, tz=ny).isoformat())
# Linux GNU date (seconds)
date -u -d @1700000000
# macOS BSD date (seconds)
date -u -r 1700000000
# Convert milliseconds (divide by 1000)
echo $((1700000000000/1000)) | xargs -I{} date -u -d @{}
-- PostgreSQL (seconds)
SELECT to_timestamp(1700000000) AT TIME ZONE 'UTC';
-- PostgreSQL (milliseconds)
SELECT to_timestamp(1700000000000 / 1000.0) AT TIME ZONE 'UTC';
-- MySQL / MariaDB (seconds)
SELECT FROM_UNIXTIME(1700000000);
-- BigQuery (seconds)
SELECT TIMESTAMP_SECONDS(1700000000);
-- BigQuery (milliseconds)
SELECT TIMESTAMP_MILLIS(1700000000000);
1700000000=TEXT((A2/86400)+DATE(1970,1,1), "yyyy-mm-dd hh:mm:ss")
For milliseconds:
=TEXT((A2/1000/86400)+DATE(1970,1,1), "yyyy-mm-dd hh:mm:ss")
Note: Excel handles timezones poorly. Treat results as UTC unless you adjust with your offset.
YYYY-MM-DDTHH:MM:SSZNov 14, 2023 5:13:20 PM EST2023-11-14 22:13:20 UTCBest for APIs and logs: ISO 8601 with Z or an offset (+00:00).
Example mapping:
1699990000 s → 2023-11-14 19:26:40 UTC1700000000000 ms → 2023-11-14 22:13:20 UTC1700000000000000 µs → 2023-11-14 22:13:20 UTCAmerica/Los_Angeles) and tested libraries.Z.created_at_ms.| Method | When to Use | Pros | Cons |
|---|---|---|---|
| ZenixTools Epoch Converter | Quick one-off checks, QA, support | Fast, no setup, human-friendly, supports UTC/local | Manual step for large batches |
JavaScript Date | Web apps, Node scripts | Built-in, easy ISO 8601 | Timezone formatting can be verbose |
Python datetime | Data pipelines, backends | Powerful, timezone-aware with zoneinfo | Requires careful unit handling |
| SQL functions | Analytics, reporting in DB | Pushes compute to DB, scalable | Vendor syntax differs |
CLI date | DevOps, SSH sessions | Instant, scriptable | OS differences (GNU vs BSD) |
| Excel/Sheets | Business users, quick analysis | Familiar, no code | Timezone handling is limited |
new Date(epoch * 1000).toISOString(); for milliseconds: new Date(epoch).toISOString().datetime.fromtimestamp(epoch, tz=timezone.utc).isoformat(); divide by 1000 if epoch is in milliseconds.Intl.DateTimeFormat with timeZone. Python: ZoneInfo('Region/City').date -u -d @<seconds> (GNU date) for UTC. On macOS, use date -u -r <seconds>.=TEXT((A2/86400)+DATE(1970,1,1), "yyyy-mm-dd hh:mm:ss").2023-11-14T22:13:20Z or with an offset like +00:00.µs / 1e6), keep a high-precision type if you need sub-second detail.Intl.DateTimeFormat, Python ZoneInfo, or DB functions with AT TIME ZONE.datetime — https://docs.python.org/3/library/datetime.htmlto_timestamp — https://www.postgresql.org/docs/current/functions-datetime.htmlFROM_UNIXTIME — https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_from-unixtimedate — https://www.gnu.org/software/coreutils/manual/html_node/date-invocation.htmlDateTime — https://schema.org/DateTimeConverting epoch to time is simple once you confirm the unit and choose the right timezone. Use built-in functions in JavaScript, Python, SQL, Excel, or the CLI, and standardize on UTC and ISO 8601 for clean data. With these best practices, you will avoid DST and unit errors, and you will convert epoch to time accurately across systems.
Ready to move faster? Try ZenixTools’ free Epoch Converter to paste a timestamp, pick UTC or local, and copy a clean ISO 8601 result. For teams, bookmark it for support, audits, and QA. When you need to convert epoch to time at scale, use your favorite language or SQL—and use ZenixTools for quick spot checks and demos.
Learn how to convert 1 meter to feet with precise formulas, quick methods, and real-world examples. Includes best practices, common mistakes, comparison tables, FAQs, and expert tips for accurate length conversions.
Learn how to convert 1 meter to feet with the exact formula, step-by-step instructions, quick mental math, and real-world examples. Includes charts, best practices, FAQs, and expert tips.