Unix Timestamp Converter
Convert Unix timestamps to human-readable dates. Get code snippets for Go, Python, JavaScript, PHP, Java and Rust.
Current Unix Timestamp
1787052133
2026-08-18T11:22:13.000Z
ISO 8601 / RFC 33392026-08-18T11:22:13.000Z
UTC (RFC 2822)Tue, 18 Aug 2026 11:22:13 GMT
Local time8/18/2026, 11:22:13 AM
Milliseconds1787052133000
Relativein 0s
Code Snippet
What is a Unix Timestamp?
A Unix timestamp (also called Unix time, POSIX time, or epoch time) is the number of seconds that have elapsed since January 1, 1970 00:00:00 UTC — the Unix epoch. It is a language-agnostic, timezone-agnostic way to represent a specific moment in time as a single integer.
APIs and databases often store timestamps as Unix integers. Millisecond precision timestamps (13 digits) are also common in JavaScript APIs — divide by 1000 to get seconds.
Format Comparison
| Format | Example | Use case |
|---|---|---|
| Unix seconds | 1748217600 | APIs, databases, Go, Python, Rust |
| Unix milliseconds | 1748217600000 | JavaScript Date, Java Instant.toEpochMilli() |
| ISO 8601 | 2025-05-26T00:00:00Z | JSON APIs, HTTP headers, logs |
| RFC 3339 | 2025-05-26T00:00:00Z | Go time.RFC3339, gRPC Timestamps |
| RFC 2822 (UTC) | Mon, 26 May 2025 00:00:00 +0000 | Email headers, HTTP Last-Modified |
Go Timestamp Patterns
go
import "time"
// Current timestamp
now := time.Now().Unix() // seconds
nowMs := time.Now().UnixMilli() // milliseconds (Go 1.17+)
// Parse a timestamp
t := time.Unix(1748217600, 0).UTC()
fmt.Println(t.Format(time.RFC3339)) // 2025-05-26T00:00:00Z
// Parse ISO 8601 string
t2, _ := time.Parse(time.RFC3339, "2025-05-26T00:00:00Z")
fmt.Println(t2.Unix()) // 1748217600
// Format options
t.Format(time.RFC3339) // 2025-05-26T00:00:00Z
t.Format("2006-01-02") // 2025-05-26 (Go's reference time)
t.Format("02 Jan 2006 15:04") // 26 May 2025 00:00Python Timestamp Patterns
python
from datetime import datetime, timezone
# Current timestamp
now = datetime.now(timezone.utc).timestamp() # seconds (float)
now_ms = int(now * 1000) # milliseconds
# Timestamp -> datetime (UTC)
dt = datetime.fromtimestamp(1748217600, tz=timezone.utc)
print(dt.isoformat()) # 2025-05-26T00:00:00+00:00
# ISO 8601 string -> timestamp
dt2 = datetime.fromisoformat("2025-05-26T00:00:00+00:00")
print(dt2.timestamp()) # 1748217600.0JavaScript Timestamp Patterns
javascript
// Current timestamp
const nowMs = Date.now(); // milliseconds
const nowSec = Math.floor(Date.now() / 1000); // seconds
// Timestamp -> Date
const d = new Date(1748217600 * 1000); // Date expects milliseconds
console.log(d.toISOString()); // 2025-05-26T00:00:00.000Z
// ISO 8601 string -> timestamp
const t = new Date("2025-05-26T00:00:00Z").getTime(); // ms
console.log(Math.floor(t / 1000)); // 1748217600Where Timestamp Conversion Comes Up
- ▸Debugging an API response — Turn a raw createdAt: 1748217600 field into a readable date without writing a script.
- ▸Reading database or log timestamps — Convert a stored epoch value from a log line or DB row to check exactly when an event happened in your timezone.
- ▸Building a 'time ago' feature — Compare a stored timestamp to now to compute a relative time string like '3 hours ago' for a UI.
- ▸Scheduling and expiry checks — Verify a JWT's exp claim or a cache TTL by converting its Unix timestamp into a human-readable expiry date.