Timestamp Converter


Date / Time → Epoch
Seconds:
Milliseconds:
Epoch → Date / Time
Enter seconds or milliseconds — auto-detected.
UTC:
Local:
ISO 8601:

Current Time
Seconds:
Milliseconds:
UTC:

How It Works

This tool converts between human-readable date/time values and Unix timestamps — entirely inside your browser. No data is sent to a server.

What is a Unix Timestamp?

A Unix timestamp (also called an epoch timestamp) is the number of seconds — or milliseconds — that have elapsed since 00:00:00 UTC on 1 January 1970, known as the Unix epoch. It is a timezone-independent, language-agnostic way to represent a point in time and is widely used in databases, APIs, log files, and JWT tokens.

Implementation Details

All date arithmetic uses JavaScript's built-in Date object — no third-party library is needed.

  • Date/Time → Epoch: The <input type="datetime-local"> value is parsed with new Date(val). Date.getTime() returns the Unix timestamp in milliseconds; dividing by 1000 and flooring gives seconds. The input is pre-filled with the current local time for convenience.
  • Epoch → Date/Time: The raw number is checked against a threshold of 1010 (approximately November 2286 in seconds). Values above this threshold are treated as milliseconds; values below are multiplied by 1000 and treated as seconds. The resulting Date object is then formatted as UTC, local, and ISO 8601 strings using the browser's native formatting methods.
  • Live clock: A setInterval callback fires every second, calling new Date() and updating the current seconds, milliseconds, and UTC string in real time.
Output Formats
FormatMethodExample
UTCDate.toUTCString()Sat, 01 Jan 2000 00:00:00 GMT
LocalDate.toLocaleString()Depends on browser locale
ISO 8601Date.toISOString()2000-01-01T00:00:00.000Z
Privacy

All conversions run locally in your browser tab. No timestamps or dates are transmitted anywhere.