Unix timestamp

Convert Unix seconds to readable date and back using the browser timezone.

Overview

The Unix timestamp starts at January 1st, 1970, at 00:00:00 UTC — a date chosen arbitrarily by Ken Thompson and Dennis Ritchie at Bell Labs when they were developing Unix in the late 1960s. When you write `time()` in PHP, `Date.now()` in JavaScript, or `datetime.now().timestamp()` in Python, the number you get is the count of seconds or milliseconds since that moment. For decades this counter was stored as a signed 32-bit integer, which means it will overflow on January 19th, 2038 at 03:14:07 UTC — the Y2K38, the Year 2038 Problem. 64-bit systems solve this: a 64-bit integer can hold approximately 292 billion years, well beyond the support window of any software currently in production.

The great strength of the Unix timestamp is that it is unambiguous by definition. A date like `01/02/2025` can mean January 2nd or February 1st depending on the system locale. A timestamp like `1748180200` is a single point in time, identical in Tokyo, New York, and São Paulo. Timestamps are also trivially sortable — comparing two integers is faster and simpler than parsing and comparing date strings. One detail that causes bugs regularly: `10 digits = seconds`, `13 digits = milliseconds`. Mixing them up is a classic mistake: passing milliseconds where the code expects seconds results in a date equivalent to the year 57,000, while passing seconds where milliseconds are expected produces dates in 1970.

The golden rule when working with timestamps is: always store in UTC, convert only when displaying. This avoids an entire category of bugs related to daylight saving time, timezone changes, and configuration differences between servers. In JavaScript, `new Date(timestamp * 1000)` creates a `Date` object from a seconds-based timestamp — the `* 1000` converts to milliseconds, which is what the constructor expects. For displaying dates in a localized and accessible way, the modern `Intl.DateTimeFormat` is superior to the older `toLocaleDateString()`: it accepts an explicit locale, detailed formatting options, and works consistently across all modern browsers.

Technical deep dive

Common questions summarized

  • What is this tool for?: It runs fully in your browser: useful to validate, format, or convert data in everyday development.
  • Are my inputs sent to a server?: Processing happens locally with JavaScript. We do not store what you paste into the text areas.
  • Can I use this for real production data?: Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.

Sample payload to try

  • See also the larger "Code Snippets" sample; paste this excerpt to try locally: Tip — Se o valor parecer grande demais, pode estar em milissegundos (divida por 1000).

Tool guide

  • What Unix time is Seconds (or milliseconds) since 1970-01-01 00:00 UTC, used in logs, JWT exp, databases, and APIs.

  • What the tool does Converts between timestamp and human-readable date using the browser timezone where appropriate.

  • Why use it Read DB/API values, debug token expiry, avoid mixing seconds and milliseconds.

Code Snippets

Code example
Se o valor parecer grande demais, pode estar em milissegundos (divida por 1000).

Tip

Se o valor parecer grande demais, pode estar em milissegundos (divida por 1000).

FAQ

What is this tool for?

It runs fully in your browser: useful to validate, format, or convert data in everyday development.

Are my inputs sent to a server?

Processing happens locally with JavaScript. We do not store what you paste into the text areas.

Can I use this for real production data?

Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.