HomeTime Converter › Unix Timestamp Converter

Unix Timestamp Converter

Convert Unix timestamps to readable dates (UTC / Local / ISO8601 / RFC 2822) and back. Built for tech, dev, and debugging.

Auto-detects seconds vs milliseconds (10 vs 13 digits). Negative timestamps (pre-1970) supported.

How the Unix Timestamp Converter Works

Unix → Date: we create a JavaScript Date using milliseconds: new Date(timestamp * 1000) (for seconds). Date → Unix: we convert back: Math.floor(date.getTime() / 1000).

Seconds vs Milliseconds (Auto Detect)

Many systems use Unix timestamps in seconds (10 digits) while JavaScript often uses milliseconds (13 digits). This tool detects the likely format automatically and converts correctly.

Formats Included

Examples (Copy/Paste Inputs)

Here are common values you’ll see in logs, analytics, APIs, and databases. Paste any of these into the converter:

  • 1700000000 → Unix seconds (typical backend/log format)
  • 1700000000000 → Unix milliseconds (common in JavaScript)
  • 2026-02-13T12:00:00Z → ISO 8601 UTC (recommended)
  • Fri, 13 Feb 2026 12:00:00 GMT → RFC 2822-style string
  • -1 → one second before epoch (1969-12-31T23:59:59Z)

Common Unix Timestamps (Quick Reference)

These are popular “landmark” timestamps. Values below are Unix seconds. If you need milliseconds, multiply by 1000.

Event Unix (seconds) ISO 8601 (UTC) Notes
Unix epoch 0 1970-01-01T00:00:00Z Start of Unix time
Y2K 946684800 2000-01-01T00:00:00Z Common test case
1 Jan 2020 1577836800 2020-01-01T00:00:00Z Nice sanity check
“Now” (use Current timestamp) (auto) Best for debugging “current time” issues

Developer Snippets (JS / Python / SQL)

Handy copy/paste examples for common environments. These are the same transformations used by this tool.

JavaScript

// seconds → Date
new Date(1700000000 * 1000)

// milliseconds → Date
new Date(1700000000000)

// Date → seconds (UTC moment)
Math.floor(Date.now() / 1000)

// Date string (ISO) → seconds
Math.floor(new Date("2026-02-13T12:00:00Z").getTime() / 1000)

Python

from datetime import datetime, timezone

# seconds → datetime (UTC)
datetime.fromtimestamp(1700000000, tz=timezone.utc)

# now → seconds (UTC)
int(datetime.now(tz=timezone.utc).timestamp())

# milliseconds → datetime (UTC)
datetime.fromtimestamp(1700000000000 / 1000, tz=timezone.utc)

PostgreSQL

-- seconds → timestamp
SELECT to_timestamp(1700000000);

-- timestamp → seconds
SELECT extract(epoch from now())::bigint;

-- milliseconds → timestamp
SELECT to_timestamp(1700000000000 / 1000.0);

MySQL

-- seconds → datetime
SELECT FROM_UNIXTIME(1700000000);

-- datetime → seconds
SELECT UNIX_TIMESTAMP(UTC_TIMESTAMP());

-- milliseconds → datetime
SELECT FROM_UNIXTIME(1700000000000 / 1000);

Common Pitfalls (Timezone, DST, Parsing)

My result is off by 1–2 hours

That’s almost always a timezone or daylight saving time (DST) difference. Unix timestamps represent an absolute instant; the “Local” output depends on your device timezone and DST rules. Use the UTC or ISO 8601 (UTC) output for consistent comparisons.

JavaScript parses my date differently

A date string without a timezone (example: 2026-02-13T12:00:00) may be treated as local time by browsers. Prefer explicit UTC with a trailing Z: 2026-02-13T12:00:00Z.

Seconds vs milliseconds confusion

If your timestamp has 13 digits, it’s usually milliseconds. If it has 10 digits, it’s usually seconds. This converter auto-detects the unit, and also outputs both normalized values.

“Out of range” timestamps

JavaScript Date supports a limited range. Extremely large (or very negative) timestamps may fail to parse. In that case, try converting using a backend language or database functions (see the snippets above).

Frequently Asked Questions

Can it handle negative timestamps?

Yes. Negative Unix timestamps represent dates before 1970-01-01.

Does it support 13-digit timestamps?

Yes. 13-digit values are treated as milliseconds by default (auto-detected).

What’s the difference between Unix time and a date string?

Unix time is a number representing seconds (or milliseconds) since the epoch. A date string (like ISO 8601) is a human-readable representation that can include a timezone offset.

Which format should I use in APIs?

If you control the API, ISO 8601 with timezone (e.g. 2026-02-13T12:00:00Z) is usually the most portable. For compact storage or numeric comparisons, Unix seconds are common too.