Unix Timestamp Converter
Convert epoch values across seconds, milliseconds, microseconds, and nanoseconds. Copy formatted results for logs, APIs, and database workflows.
Current Time Snapshot
UTC Time
--
Local Time
--
ISO 8601
--
RFC 2822
--
Unix Timestamp Seconds
--
Unix Timestamp Milliseconds
--
Timestamp Input Converter
Supports seconds (10), milliseconds (13), microseconds (16), and nanoseconds (19).
Human-readable Duration
- 60 seconds = 1 minute
- 3,600 seconds = 1 hour
- 86,400 seconds = 1 day
Programming Examples
JavaScript
// current timestamp
const ts = Math.floor(Date.now() / 1000);
// timestamp to date
const date = new Date(ts * 1000).toISOString();Python
import time, datetime
# current timestamp
ts = int(time.time())
# timestamp to date
date = datetime.datetime.utcfromtimestamp(ts).isoformat()PHP
<?php
$ts = time();
$date = gmdate('c', $ts);Go
package main
import (
"fmt"
"time"
)
func main() {
ts := time.Now().Unix()
fmt.Println(ts)
fmt.Println(time.Unix(ts, 0).UTC())
}MySQL
-- current timestamp
SELECT UNIX_TIMESTAMP();
-- timestamp to date
SELECT FROM_UNIXTIME(1716547200);PostgreSQL
-- current timestamp
SELECT EXTRACT(EPOCH FROM NOW())::bigint;
-- timestamp to date
SELECT TO_TIMESTAMP(1716547200);Bash
# current timestamp
date +%s
# timestamp to date (UTC)
date -u -d @1716547200What is Unix timestamp?
Unix timestamp is the count of elapsed seconds since 1970-01-01T00:00:00Z. It is widely used because it is compact, easy to compare, and language-neutral.
What is epoch time?
Epoch time is another name for Unix time. Developers use both terms interchangeably when discussing backend timing and distributed systems.
Unix timestamp vs milliseconds
Seconds are common in backend APIs. Milliseconds are common in JavaScript and frontend telemetry. Always validate units before conversion to avoid date drift.
Why Unix time starts in 1970
Unix selected 1970-01-01 UTC as a practical zero point. It became the industry baseline for many operating systems and protocol implementations.
The Year 2038 problem
Signed 32-bit integer timestamps can overflow in 2038. Use 64-bit timestamp storage and modern runtime libraries to remain safe.
UTC vs local time
Store and compare timestamps in UTC. Convert to local time only when presenting data to users.
Common timestamp mistakes
Common issues include mixing seconds with milliseconds, parsing local datetime as UTC, and omitting timezone offsets in logs and API contracts.
FAQ
- Does this converter support microseconds and nanoseconds?
- Yes, 16-digit microseconds and 19-digit nanoseconds are auto-detected.
- Is this converter server-side?
- No, all calculations run in the browser for privacy and static deployment compatibility.
- Why are my converted dates different between machines?
- Local output depends on timezone settings. Use UTC or ISO fields for a shared reference.