realepochconverter
date to epoch

Date to Epoch Converter — Date to Unix Timestamp

Type a date — any common format — and get the exact Unix timestamp (epoch) in seconds, milliseconds, or microseconds, in the timezone you need.

converter

One timestamp, every format.

Convert epoch time to dates and back. Precision auto-detected, timezone your choice.

Dates below render in the timezone above. Press / to focus the field.

Deep-link any timestamp with?ts=1722750000

How to convert a date to a Unix timestamp

Switch the converter above to Date → Timestamp, type any date string, and the epoch value appears in seconds, milliseconds, and microseconds at once. You can also use the built-in date-time picker to choose a moment without typing.

Accepted inputs include 2026-08-05 12:00:00, Aug 5, 2026 12:00 PM,2026-08-05T12:00:00Z, and the numeric 08/05/2026 12:00. The date-to-epoch conversion is the exact inverse of theUnix timestamp to date converter.

Timezone is everything

A date string without a timezone is ambiguous: 2026-08-05 12:00 in UTC is a different timestamp than the same wall-clock time in Asia/Kolkata (five and a half hours earlier). This converter reads dates in your local timezone by default — matching how most people type them — and you can switch to UTC or any IANA zone with the timezone picker.

  • Server timestamps are almost always UTC — choose UTC to match your logs and database values.
  • Human-readable dates ("the meeting at 2 PM my time") should use your Local timezone.
  • Append Z to a string (2026-08-05T12:00:00Z) to force UTC interpretation.

Example conversions

  • 2024-01-01 00:00 UTC1704067200 (10-digit seconds).
  • 2026-08-05 12:00 UTC1785931200.
  • The same date in milliseconds → 1785931200000, and in microseconds → 1785931200000000.

If you are storing a value in a database or sending it through an API, copy the column that matches your system's unit — most databases store 10-digit seconds, while most JavaScript APIs expect 13-digit milliseconds.

Common date-to-epoch mistakes

  • Assuming local when the system means UTC — off-by-hours bugs in logs and scheduled jobs are usually this.
  • Rounding instead of flooring2026-08-05 12:00:59 still belongs to second 1785931259, not the next one.
  • Milliseconds vs seconds in APIs — sending 1785931200 where 1785931200000 is expected shifts the date by about 56,000 years.
  • The year 2038 problem — on 32-bit systems, seconds-based timestamps overflow in 2038; milliseconds-based values bought systems more headroom.

Date to epoch in your own code

For one-off checks this page is fastest, but when you need the conversion in a script, these one-liners do the same job:

  • JavaScript: Math.floor(new Date("2026-08-05T12:00:00Z").getTime() / 1000)
  • Python: int(datetime.fromisoformat("2026-08-05 12:00:00+00:00").timestamp())
  • PHP: strtotime("2026-08-05 12:00:00 UTC")
  • MySQL: UNIX_TIMESTAMP('2026-08-05 12:00:00') (interpreted in the session timezone)

Batch date conversion

The batch converter handles lists of epoch values rather than dates, but you can convert whole spreadsheets of timestamps to readable dates and export them as TSV or CSV in one click. See also themilliseconds to epoch converter for high-precision values.

Related converters

Copied