Skip to content
dz / timestamp-converter
Time

Unix timestamp

Unix epoch (s / ms) ⇄ UTC, local and ISO 8601 date.

/ts

Unix (s)
—
Unix (ms)
—
ISO 8601 UTC
—
UTC (RFC 7231)
—
Local
—
Relative
—
Now —
▸ About this tool

About the Unix Timestamp Converter

Introduction

A Unix timestamp (also called epoch time or POSIX time) counts the seconds since 1 January 1970, 00:00:00 UTC. It is how most operating systems, databases, log files, APIs and JSON Web Tokens store a moment in time: a single number, the same everywhere in the world, with no time zone or calendar format to get wrong. This converter turns a timestamp into a readable date and any date back into a timestamp, as you type.

How to use it

  1. Type or paste a timestamp – 1731150000 – or a date such as 2024-11-09 12:00 or 2024-11-09T11:00:00Z. The result appears immediately; there is nothing to press.

  2. Read the moment as Unix seconds and milliseconds, ISO 8601 in UTC, the HTTP date format (RFC 7231), your local time with its offset, and relative to now ("2 years ago"). Every line has a copy button.

  3. A number is read as seconds or milliseconds automatically: 12 digits or more means milliseconds. Switch from Auto to s or ms to force one. The line under the input always says how your value was read.

  4. Now inserts the current time; the live clock below the results shows the current timestamp every second.

Short links: develzone.org/ts, /epoch and /unix. Pasting a timestamp or an ISO date into the search box on the home page opens the converter with it, and Share copies a link to your value.

Dates, time zones and the usual traps

  • Seconds or milliseconds? Unix tools, PHP, Python and most databases use seconds; JavaScript, Java and many JSON APIs use milliseconds. A date in 1970 or far in the future usually means the unit is wrong.

  • A date without a time zone (2024-11-09 12:00) is read as your local time. Add Z or an offset like +02:00 to mean a specific zone. A date alone (2024-11-09) is read as midnight UTC, the way JavaScript does it.

  • Local time uses the time zone set on your device. The timestamp itself never depends on it – only the way it is displayed does.

  • Negative timestamps are dates before 1970: -86400 is 31 December 1969.

Getting the current timestamp in code

JavaScript   Math.floor(Date.now() / 1000)      // Date.now() is in ms
Python       int(time.time())
PHP          time()
Java         Instant.now().getEpochSecond()
C#           DateTimeOffset.UtcNow.ToUnixTimeSeconds()
Bash         date +%s
MySQL        SELECT UNIX_TIMESTAMP();
PostgreSQL   SELECT extract(epoch FROM now());

Privacy

Everything is calculated in your browser. The values you enter are not sent anywhere – except in a link you choose to share.

Interesting facts

  • Unix time ignores leap seconds: every day is exactly 86,400 seconds long, so a timestamp can always be converted with simple arithmetic.

  • Systems that store the timestamp as a signed 32-bit number run out at 2147483647 – 19 January 2038, 03:14:07 UTC. This "Year 2038 problem" is why modern systems use 64 bits.

  • The billionth second, 1000000000, passed on 9 September 2001 at 01:46:40 UTC; 2000000000 will arrive on 18 May 2033 at 03:33:20 UTC.

  • The exp and iat claims of a JSON Web Token are Unix timestamps in seconds – the JWT decoder shows them as dates. For recurring times, see the cron expression tool.

❯ Esc
↑ ↓ select ↵ open Shift ↵ new line