Unix timestamp converter

What is an Unix Timestamp Converter?

A Unix timestamp counts the seconds since 1 January 1970 00:00:00 UTC, the Unix epoch. It is how most databases, logs, APIs and programming languages represent moments in time internally, because it is a single number that is independent of time zones. This converter turns timestamps into human-readable dates and back.

How to use it

  1. Paste a timestamp to see it as ISO 8601, UTC, your local time and relative time (such as 3 hours ago).
  2. Or pick a date and time to get its timestamp in seconds and milliseconds.

Seconds or milliseconds?

Unix tools, PHP, Python's time.time() and most databases use seconds: a current value has 10 digits, such as 1793093400. JavaScript's Date.now() and Java use milliseconds: 13 digits, such as 1793093400000. The converter detects which one you pasted from the length.

Example

1793093400 is 2026-10-27T09:30:00Z, which is 15:00 in India (IST) and 05:30 in New York (EDT).

Code snippets

  • JavaScript: Math.floor(Date.now() / 1000) and new Date(ts * 1000).toISOString()
  • Python: int(time.time()) and datetime.fromtimestamp(ts, tz=timezone.utc)
  • Shell: date +%s and date -u -d @1793093400
  • PostgreSQL: to_timestamp(1793093400) and extract(epoch from now())

Good to know

  • Unix time ignores leap seconds.
  • Signed 32-bit timestamps overflow on 19 January 2038 (the Year 2038 problem); use 64-bit integers.
  • Negative timestamps represent dates before 1970.

Frequently Asked Questions

What is a Unix timestamp?

The number of seconds elapsed since 1 January 1970 at 00:00:00 UTC.

How can I tell seconds from milliseconds?

Current timestamps in seconds have 10 digits, while timestamps in milliseconds have 13 digits.

Do Unix timestamps depend on time zone?

No. They always count from the epoch in UTC. Time zones only matter when converting to a readable local date.

What is the Year 2038 problem?

Signed 32-bit timestamps run out on 19 January 2038. Systems should store timestamps as 64-bit integers.