ConverterNew

Unix Timestamp Converter with Milliseconds

Convert Unix timestamps to human-readable dates and vice versa

100% client-side — your data never leaves your browserNo data stored or uploadedFree for lifetime · No signup

Timestamp → Date

Date → Timestamp

What is a Unix timestamp?

A Unix timestamp counts the seconds elapsed since January 1, 1970 at 00:00:00 UTC — the Unix epoch. It's the standard way machines store points in time: you'll find it in server logs, API responses, database columns, JWT claims like exp and iat, and cron debugging output. Compact and timezone-free, it's ideal for computers and unreadable for humans.

This converter goes both directions: paste a timestamp to get UTC, local, ISO 8601 and relative renderings, or paste a date string (or pick one from the calendar input) to get the epoch value in seconds and milliseconds. It auto-detects the unit — 10 digits or fewer is treated as seconds, more as milliseconds — which catches the single most common off-by-1000 mistake. Everything runs in your browser; nothing you enter is uploaded or logged.

When to use it

Reach for it when you're staring at raw epoch values in a log line and need to know whether that request happened before or after the deploy, when a JWT's exp claim needs sanity-checking, or when an API rejects your date and you need the exact epoch value for a query parameter or test fixture.

The dual UTC/local output matters more than it looks: a surprising number of "missing data" bugs are really a timezone offset between the server's UTC storage and the browser's local rendering. Seeing both side by side settles the question immediately, and the relative line ("3h ago") tells you at a glance whether a value is plausibly recent or wildly wrong.

Example

Paste 1700000000 and convert: you get Tue, 14 Nov 2023 22:13:20 GMT as UTC, the same instant in your local timezone, the ISO form 2023-11-14T22:13:20.000Z, and how long ago that was. Going the other way, enter 2025-01-01T00:00:00Z to get 1735689600 seconds (1735689600000 ms) — ready to drop into a query or a test. The "Copy link to this result" button encodes your input into the URL fragment so a teammate opens the page with the same conversion already done.

Unix time in Python, JavaScript and SQL

Every language has a one-liner for the current epoch and for converting back, and the trap is always the unit.

JavaScript: Date.now() returns milliseconds, so Math.floor(Date.now() / 1000) gives seconds, and new Date(1700000000 * 1000).toISOString() goes the other way. Python: time.time() returns seconds as a float (int(time.time()) for a whole number), and datetime.fromtimestamp(1700000000, tz=timezone.utc) converts back. Leave out tz and you get naive local time, a classic source of off-by-hours bugs. In the other direction, datetime(2025, 1, 1, tzinfo=timezone.utc).timestamp() returns 1735689600.0.

SQL differs by engine. MySQL: UNIX_TIMESTAMP() for now, FROM_UNIXTIME(1700000000) for a DATETIME rendered in the session time zone. PostgreSQL: extract(epoch from now()) for now, to_timestamp(1700000000) for a timestamptz. SQL Server has no epoch function: DATEADD(second, 1700000000, '1970-01-01') converts, and DATEDIFF_BIG(second, '1970-01-01', SYSUTCDATETIME()) gives the current value. SQLite: strftime('%s', 'now') and datetime(1700000000, 'unixepoch').

If your code shows a date in January 1970, it treated seconds as milliseconds; if it shows a year in the tens of thousands, it treated milliseconds as seconds. Paste the raw value here — the digit-count check picks the right unit — and compare.

UTC timestamps and the year 2038 problem

A Unix timestamp has no time zone: 1700000000 is the same instant in Tokyo and in Toronto. "UTC timestamp" and "Unix timestamp" therefore mean the same number — the zone only appears when you render it, which is why this tool shows a UTC line and a Local line for one input. Store and transmit epoch values, or ISO 8601 strings with a Z or an offset, and convert to local time only at the display edge.

One quirk on the date-to-epoch side: JavaScript parses a date-only string like 2025-01-01 as UTC midnight, but a date-time without an offset like 2025-01-01T00:00 as local time. Add Z or +05:30 explicitly when the answer matters.

The year 2038 problem comes from systems that store the count as a signed 32-bit integer. Its maximum, 2147483647, is 03:14:07 UTC on 19 January 2038; one second later the value wraps negative and reads as December 1901. Paste 2147483647 here to see the boundary. 64-bit time_t, JavaScript (milliseconds in a double) and most current databases are unaffected, but MySQL's TIMESTAMP column type, older embedded firmware and binary formats with 32-bit time fields still carry the limit — use DATETIME or a BIGINT column for dates past 2038.

How to use the Unix Timestamp Converter with Milliseconds tool

  1. 1

    Paste a timestamp or a date

    Use the left card for epoch-to-date, the right card for date-to-epoch. "Use current time" fills in the present moment.

  2. 2

    Convert

    The result panel shows UTC, local, ISO 8601 and relative time — or seconds, milliseconds and ISO when converting a date.

  3. 3

    Copy or share

    Copy the result, or copy a permalink that reruns the same conversion for whoever opens it.

Frequently asked questions

How does the tool know if my value is seconds or milliseconds?

By length: values with 10 or fewer digits are treated as seconds, longer values as milliseconds. Current epoch seconds are 10 digits (until the year 2286), while millisecond timestamps are 13, so the heuristic is reliable for real-world values.

Which timezone is the output in?

Both. The UTC line is timezone-independent; the Local line uses your browser's timezone setting. The ISO 8601 line is always UTC (the trailing Z). If two people see different Local lines for the same link, that's their machines' timezones — the instant is identical.

Is anything I enter sent to a server?

No. Conversion is plain JavaScript Date arithmetic running entirely in your browser. Timestamps and dates you paste never leave your machine.

Can I convert negative timestamps or dates before 1970?

Yes — negative epoch values represent instants before January 1, 1970 and JavaScript dates handle them fine. Note that some external systems (especially ones storing timestamps as unsigned 32-bit integers) cannot, so check the consumer of the value.

How do I get the current Unix timestamp?

Click "Use current time" for the value in seconds. In code: Math.floor(Date.now() / 1000) in JavaScript, int(time.time()) in Python, date +%s in a shell, UNIX_TIMESTAMP() in MySQL, and extract(epoch from now()) in PostgreSQL.

Can I convert a date to a Unix timestamp?

Yes — use the date-to-epoch card. It accepts ISO 8601 (2025-01-01T09:30:00Z) and anything else your browser's Date parser understands, and returns seconds, milliseconds and the ISO form. Include a Z or an offset such as +05:30; a date-time without one is read in your local time zone.

Are epoch time, Unix time and POSIX time the same thing?

Yes, all three name the count of seconds since 1970-01-01T00:00:00Z. Strictly, POSIX time ignores leap seconds — every day is exactly 86,400 seconds — so it is not a true count of elapsed SI seconds, but that never matters for converting dates.

Does it handle microsecond or nanosecond timestamps?

Not directly. Anything longer than 10 digits is read as milliseconds, so a 16-digit microsecond value (common in Python's time.time_ns() // 1000, Postgres and tracing tools) or a 19-digit nanosecond value will convert to the wrong date. Divide by 1,000 or 1,000,000 first to get milliseconds.

Get the next tool before you need it

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.