EpochMasters Logo
Timestamp to Date Translator

Epoch to Date Converter

Convert any Unix timestamp into a human-readable date and time. Supports seconds, milliseconds, microseconds, and nanoseconds with instant local and UTC decoding.

Loading converter...

How to Convert Epoch to Human-Readable Date

An Epoch timestamp (also referred to as Unix time or POSIX time) represents the cumulative elapsed duration since the Unix Epoch: January 1, 1970 at 00:00:00 UTC, excluding leap seconds.

To translate a numeric timestamp back into a recognizable human date format, a computer performs simple arithmetic by adding the timestamp value to the base epoch date:

Target Date = January 1, 1970 00:00:00 UTC + (Timestamp Value in Seconds)

Because Unix timestamps are inherently coordinated in UTC, converting an epoch timestamp to a localized date requires offsetting the UTC time by your target timezone offset (e.g., UTC+05:30 for Indian Standard Time, UTC-05:00 for Eastern Standard Time).

Timestamp Precision: Seconds vs. Milliseconds to Date

One of the most frequent programming bugs is mismatching timestamp units. Modern web APIs, databases, and message brokers utilize varying degrees of temporal precision:

Seconds (10 Digits)

Standard Unix format. Used in Python, PHP, Linux core utilities, and standard SQL databases.

Example: 1730123456
Milliseconds (13 Digits)

Standard JavaScript format (Date.now()). 1,000 milliseconds equal 1 second.

Example: 1730123456789
Microseconds (16 Digits)

High-frequency database logs, distributed tracing, and Python time.time_ns() // 1000.

Example: 1730123456789123
Nanoseconds (19 Digits)

Low-latency networking, kernel metrics, and Go time.Now().UnixNano().

Example: 1730123456789123456

Convert Timestamp to Date in Code (JavaScript, Python, Go, SQL)

Copy and paste these verified snippets directly into your projects to convert epoch timestamps to readable date objects:

JavaScript / TypeScriptSeconds & Milliseconds
// From Seconds: Multiply by 1000
const dateFromSec = new Date(1730123456 * 1000);
console.log(dateFromSec.toISOString()); // e.g. "2024-10-28T13:50:56.000Z"

// From Milliseconds: Direct constructor
const dateFromMs = new Date(1730123456789);
console.log(dateFromMs.toLocaleString()); // Local formatted string
Python 3datetime module
from datetime import datetime, timezone

# Convert seconds to UTC datetime
timestamp = 1730123456
dt_utc = datetime.fromtimestamp(timestamp, tz=timezone.utc)
print(dt_utc.strftime("%Y-%m-%d %H:%M:%S UTC"))

# If your timestamp is in milliseconds:
dt_ms = datetime.fromtimestamp(1730123456789 / 1000.0, tz=timezone.utc)
SQL (PostgreSQL & MySQL)Native Functions
-- PostgreSQL:
SELECT to_timestamp(1730123456);

-- MySQL:
SELECT FROM_UNIXTIME(1730123456);

-- MySQL with milliseconds:
SELECT FROM_UNIXTIME(1730123456789 / 1000);
Go (Golang)time.Unix()
package main
import (
    "fmt"
    "time"
)
func main() {
    tm := time.Unix(1730123456, 0).UTC()
    fmt.Println(tm.Format(time.RFC3339))
}

Frequently Asked Questions: Epoch to Date

Why does JavaScript return January 1970 when I convert my timestamp?

JavaScript's new Date(value) expects milliseconds (13 digits), whereas typical Unix timestamps from Unix/Linux or backend databases are in seconds (10 digits). If you provide seconds directly, JavaScript evaluates it as 1.7 million milliseconds (less than an hour into January 1, 1970). Multiply your seconds by 1000 to resolve this.

Are Unix timestamps affected by Daylight Saving Time (DST)?

No. Unix timestamps are strictly based on UTC (Coordinated Universal Time), which does not observe Daylight Saving Time. DST only comes into effect when presenting the timestamp in a localized regional timezone.

Can an Epoch timestamp be negative?

Yes. Negative timestamps represent dates occurring prior to January 1, 1970. For example, -315360000 represents January 1, 1960 00:00:00 UTC.

Related Timestamp & Developer Tools