Convert, format, and understand Unix time with ZenixTools’ epoch unix timestamp converter. Clear steps, real examples, and expert tips for developers, analysts, and SREs.
Time is tricky. When you need a quick, correct conversion, a reliable epoch unix timestamp converter saves the day. This guide explains how to convert Unix time to readable dates and back, avoid common mistakes, and work cleanly across time zones. You’ll get practical steps, code samples, and expert tips—all optimized for speed and accuracy.
An epoch Unix timestamp converter turns seconds or milliseconds since 1970‑01‑01 00:00:00 UTC into human‑readable dates, and vice versa. Enter a timestamp (e.g., 1700000000 or 1700000000000), choose seconds or milliseconds, and select a timezone. The converter outputs ISO 8601, local time, and UTC. It also handles formatting, rounding, and daylight saving. Always confirm units (s vs ms) before converting.
Use ZenixTools to convert epoch timestamps (seconds or milliseconds since 1970‑01‑01 UTC) to readable dates or back. Pick the unit, paste your value, and view UTC, local time, and ISO 8601 outputs. The guide covers how Unix time works, seconds vs milliseconds, time zones, DST, the 2038 issue, and code examples in JavaScript, Python, Java, Go, SQL, and Bash. It also lists common mistakes, best practices, and quick fixes.
An epoch Unix timestamp converter is a tool that translates Unix time into a human‑readable date and time—and back again. Unix time (also called POSIX time or epoch time) is a running count of seconds since the Unix epoch: 1970‑01‑01 00:00:00 UTC. Many systems also use milliseconds (ms) since the epoch.
In practice, you paste a value like 1700000000 (seconds) or 1700000000000 (milliseconds) into the converter. The tool then shows:
This is essential for debugging logs, reading API data, and syncing systems.
Follow these steps to convert timestamps correctly and consistently.
Tip: Multiplying seconds by 1000 converts to milliseconds; dividing milliseconds by 1000 converts to seconds. Keep precision in mind.
You can also reverse the process: type a date/time, choose a timezone, and get the equivalent epoch.
Below are common conversions—both directions—and timezone handling.
// Now
const nowMs = Date.now(); // milliseconds since epoch
const nowSec = Math.floor(nowMs / 1000);
// From epoch seconds to Date
const tSec = 1700000000;
const dFromSec = new Date(tSec * 1000);
console.log(dFromSec.toISOString()); // UTC ISO 8601
// From epoch milliseconds to Date
const tMs = 1700000000000;
const dFromMs = new Date(tMs);
// From Date to epoch
const epochMs = dFromMs.getTime();
const epochSec = Math.floor(epochMs / 1000);
// Format in local timezone
const fmt = new Intl.DateTimeFormat(undefined, {
timeZone: 'UTC', // or your IANA zone
year: 'numeric', month: '2-digit', day: '2-digit',
hour: '2-digit', minute: '2-digit', second: '2-digit'
});
console.log(fmt.format(dFromSec));
// Precision tip: for very large ms, consider BigInt in Node 10+
import time
from datetime import datetime, timezone
# Now
now_sec = int(time.time()) # seconds
now_ms = int(time.time() * 1000) # milliseconds
# From epoch seconds
t_sec = 1700000000
print(datetime.fromtimestamp(t_sec, tz=timezone.utc).isoformat())
# From epoch milliseconds
t_ms = 1700000000000
print(datetime.fromtimestamp(t_ms / 1000, tz=timezone.utc).isoformat())
# From datetime to epoch
dt = datetime(2023, 11, 14, 22, 13, 20, tzinfo=timezone.utc)
epoch_sec = int(dt.timestamp())
epoch_ms = int(dt.timestamp() * 1000)
import java.time.*;
// Now
long nowSec = Instant.now().getEpochSecond();
long nowMs = Instant.now().toEpochMilli();
// From epoch seconds
long tSec = 1700000000L;
Instant inst = Instant.ofEpochSecond(tSec);
System.out.println(inst.toString()); // ISO 8601 UTC
// From epoch milliseconds
long tMs = 1700000000000L;
Instant instMs = Instant.ofEpochMilli(tMs);
// Timezone conversion
ZonedDateTime zdt = inst.atZone(ZoneId.of("America/New_York"));
System.out.println(zdt);
package main
import (
"fmt"
"time"
)
func main() {
// Now
nowSec := time.Now().Unix() // seconds
nowMs := time.Now().UnixMilli() // milliseconds
// From epoch seconds
tSec := int64(1700000000)
t := time.Unix(tSec, 0).UTC()
fmt.Println(t.Format(time.RFC3339))
// From epoch milliseconds
tMs := int64(1700000000000)
t2 := time.UnixMilli(tMs).UTC()
fmt.Println(t2.Format(time.RFC3339))
}
<?php
// Now
$nowSec = time();
$nowMs = (int) round(microtime(true) * 1000);
// From epoch seconds
$tSec = 1700000000;
$dt = (new DateTimeImmutable('@' . $tSec))->setTimezone(new DateTimeZone('UTC'));
echo $dt->format(DateTimeInterface::RFC3339) . "\n";
// From epoch milliseconds
$tMs = 1700000000000;
$dt2 = (new DateTimeImmutable('@' . intval($tMs / 1000)))->setTimezone(new DateTimeZone('UTC'));
echo $dt2->format('Y-m-d\TH:i:s.v\Z') . "\n"; // show ms
Note: date differs by platform.
# Linux (GNU date): from seconds
date -u -d @1700000000 +"%Y-%m-%dT%H:%M:%SZ"
# macOS (BSD date): from seconds
date -u -r 1700000000 +"%Y-%m-%dT%H:%M:%SZ"
# Now to epoch seconds
# Linux
date -u +%s
# macOS
date -u +%s
-- PostgreSQL: seconds to timestamp (UTC)
SELECT to_timestamp(1700000000) AT TIME ZONE 'UTC';
-- PostgreSQL: timestamp to epoch seconds
SELECT EXTRACT(EPOCH FROM TIMESTAMP '2023-11-14 22:13:20+00');
-- MySQL/MariaDB: seconds to datetime
SELECT FROM_UNIXTIME(1700000000);
-- BigQuery: seconds and milliseconds
SELECT TIMESTAMP_SECONDS(1700000000), TIMESTAMP_MILLIS(1700000000000);
created_at or exp in epoch (e.g., JWT). Convert them to verify lifetimes.BIGINT epoch columns to TIMESTAMP types or format for dashboards.MM/DD/YYYY vs DD/MM/YYYY confusion._sec or _ms suffixes.| Option/Format | What It Is | Pros | Cons | Best For |
|---|---|---|---|---|
| Epoch seconds | Seconds since 1970‑01‑01 UTC | Compact, fast, universal | No timezone info, whole seconds only | APIs, storage, indexing |
| Epoch milliseconds | ms since 1970‑01‑01 UTC | Higher precision | Larger numbers, potential JS precision issues | Event streams, telemetry |
| ISO 8601 (RFC 3339) | Human‑readable standard (e.g., 2023‑11‑14T22:13:20Z) | Clear, includes timezone | Slightly larger payload | Logs, APIs, UI |
| ZenixTools Converter | Web tool for conversion | Instant results, UTC/local views, both ways | Requires browser | Quick checks, debugging |
CLI date | Shell command | Fast, scriptable | Flags vary by OS | DevOps, CI/CD |
| Language APIs | Built‑in date/time libraries | Typed, testable, portable |
What is Unix time? Unix time counts seconds since 1970‑01‑01 00:00:00 UTC. It’s a simple, global standard used by operating systems, databases, and APIs.
What’s the difference between seconds and milliseconds? Seconds have 10‑digit epoch values like 1700000000. Milliseconds have 13‑digit values like 1700000000000. Mixing them causes huge date errors.
How do I convert epoch to a readable date? Use ZenixTools: paste your epoch, choose seconds or milliseconds, and view UTC/local results and ISO 8601. Or use language APIs like JavaScript’s Date, Python’s datetime, or Java’s Instant.
How do I convert a date to epoch?
In ZenixTools, enter the date/time and timezone to get seconds or milliseconds. In code, use functions like Date.getTime() (JS), datetime.timestamp() (Python), or Instant.toEpochMilli() (Java).
Why do I see an hour off around DST changes? DST shifts local clocks. Store and compute in UTC, then convert to local zones for display. Use IANA zones and reliable libraries.
What is the 2038 problem?
On 32‑bit systems, the signed 32‑bit time_t overflows on 2038‑01‑19. Use 64‑bit systems and modern runtimes to avoid this.
Does Unix time include leap seconds? POSIX time ignores leap seconds. It treats each day as exactly 86400 seconds. Use NTP and higher‑level protocols if you must handle leap seconds precisely.
How can I handle sub‑second precision?
Use milliseconds or nanoseconds if supported (e.g., Java’s Instant nanos, Go’s time.Time). Store as integers to avoid floating point errors.
What timezone should I use for storage? Use UTC for all storage and transport. Convert to local time only for display.
How do I detect if a timestamp is seconds or milliseconds? Check the digit length (10 vs 13) or range. You can also validate by converting both ways and sanity‑checking the date.
Unix time is simple once you get the basics: count from 1970‑01‑01 UTC, mind seconds vs milliseconds, and choose a clear format like ISO 8601. With the right habits and a solid tool, you’ll avoid timezone headaches, DST surprises, and precision bugs. For fast, accurate conversions, use ZenixTools’ epoch unix timestamp converter in your daily workflow.
Convert timestamps instantly with ZenixTools. Paste an epoch value or a date, choose your unit and timezone, and copy clean outputs. Try the Epoch Unix Timestamp Converter now and simplify your debugging, APIs, and data pipelines.
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.
| Learning curve |
| Production code |
Can I convert negative timestamps? Yes, if your system supports them. Negative values represent dates before 1970‑01‑01 UTC.
What format should APIs use? Prefer RFC 3339 (ISO 8601) strings with timezone, or epoch seconds for compact payloads. Document units and timezone clearly.
Why is my JavaScript timestamp imprecise? JS numbers are IEEE‑754 doubles. Very large integers lose precision. Use BigInt or string handling for very large millisecond values.
How do I convert in SQL?
PostgreSQL: to_timestamp(seconds) and extract(epoch from timestamp). MySQL: FROM_UNIXTIME(seconds) and UNIX_TIMESTAMP(datetime).
Is local device time reliable? Not always. Devices can drift. Use server time, NTP, or signed timestamps for critical systems.