English

Unix Timestamp Converter — Epoch to Date

Epoch to date and back (seconds to nanoseconds, free-text dates, period start and end, code samples)

Runs in your browser · nothing is uploaded

Current Unix time

sec—
ms—

—

Time zone

Every conversion below is calculated in this zone.

Epoch to date

Unit

Type a timestamp and the date appears here.

Date to epoch

Time zone the entered date refers to

Press the up and down arrow keys in a field to change it by 1, or by 10 with Shift. Paste a whole date into any field to fill them all. Leave hour, minute and second empty for 0.

Enter a date and the second, millisecond, microsecond and nanosecond timestamps appear here.

Start and end of a year, month or day

Get the timestamp of the first moment and the last second of a year, month or day. A day with a daylight-saving change can be 23 or 25 hours long.

Enter a year (and month, day) and the start and end timestamps appear here.

Seconds to years, months, days, hours and minutes

Turns a number of seconds into a readable duration. It uses averages: a year is 365.25 days (31,557,600 s) and a month is one twelfth of that (2,629,800 s).

Enter a number of seconds and the duration appears here.

Time to seconds reference

PeriodSeconds
1 minute60
1 hour3,600
1 day86,400
1 week604,800
1 month (30 days)2,592,000
1 month (30.4375 days, average)2,629,800
1 year (365 days)31,536,000
1 year (365.25 days, average)31,557,600

Unix time does not count leap seconds; every day is exactly 86,400 seconds. Around a leap second the same timestamp can appear twice or the clock seems to pause. JavaScript Date follows the same rule, so it cannot represent 23:59:60, and this tool rejects 60 as a second.

Current Unix time in code

Pick a language to get a snippet that prints the current time in seconds (and milliseconds where easy).

const millis = Date.now();
const seconds = Math.floor(millis / 1000);
console.log(seconds, millis);

What it is

A Unix timestamp (epoch time) counts the time since 1970-01-01 00:00:00 UTC as a single number. You meet it in logs, databases, API responses and the exp claim of a JWT, but you cannot read it at a glance. This tool turns an epoch into a readable date and a date into an epoch. The top card shows the current Unix time in seconds and milliseconds, live, and the card beside it sets the time zone for every conversion. Below are period start and end, a seconds-to-duration converter, a time-to-seconds table and code samples.

How to use

  1. Epoch to date: paste a timestamp. Seconds, milliseconds, microseconds and nanoseconds are detected automatically, and you get the local date, UTC, ISO 8601, RFC 2822, HTTP date, relative time, weekday, ISO week and day of the year.
  2. Date to epoch: under “Type in fields” enter year, month, day, hour, minute and second (milliseconds optional) in separate boxes. The up and down arrow keys change a value, pasting a whole date into any box fills them all, and “Now” inserts the current time. A 24-hour or AM/PM style and a UTC toggle are there too.
  3. Prefer a picker? Choose “Calendar and clock picker”. Prefer writing the date as text? Choose “Free-text date”; it is parsed as you type.
  4. Start and end of a year, month or day: pick the period and the date to get the first moment and the last second as timestamps.
  5. Seconds to duration: enter a number of seconds to see it as years, months, days, hours, minutes and seconds. Use the copy button beside any result.

How it works

  • Unit rule on the absolute value: under 1e11 seconds, under 1e14 milliseconds, under 1e17 microseconds, otherwise nanoseconds. Negative values are before 1970.
  • ISO 8601 is shown in UTC (Z) and with the offset of the selected zone (+09:00). For microsecond and nanosecond input the UTC value is written out to nine fractional digits.
  • RFC 2822 is the email-header format with an offset; the HTTP date is the GMT format of the Date and Expires headers (RFC 9110). Week numbers follow ISO 8601: weeks start on Monday and week 1 holds the first Thursday.
  • Start and end: the start is 00:00:00 in the zone, and the end is the next period start minus one second. A day with a daylight-saving change is 23 or 25 hours long, and where midnight itself is skipped the first time that actually exists is used.
  • The duration breakdown uses averages: a year is 365.25 days (31,557,600 s) and a month is one twelfth of that (2,629,800 s).
  • A wall-clock time that a daylight-saving jump skips is an error, and a time that occurs twice resolves to the earlier one.

Examples

Input Read as UTC date
0 seconds 1970-01-01T00:00:00.000Z
1700000000 seconds 2023-11-14T22:13:20.000Z
1700000000123 milliseconds 2023-11-14T22:13:20.123Z
1700000000123456 microseconds 2023-11-14T22:13:20.123456000Z
1700000000123456789 nanoseconds 2023-11-14T22:13:20.123456789Z

The same 1700000000 in Korea is 2023-11-15 07:13:20 (+09:00), and Oct 4, 2026 3:05 PM in Seoul is 1791093900.

Notes

  • When timestamps in two logs look out of step, check the unit and the zone first. One side being seconds and the other milliseconds is very common.
  • JavaScript Date.now() returns milliseconds, while most Unix tools and UNIX_TIMESTAMP() in databases return seconds. The code samples at the bottom show the call for each language.
  • In a zone with daylight saving, such as America/New_York, a time skipped in spring is reported as nonexistent.

FAQ

How does it tell seconds, milliseconds, microseconds and nanoseconds apart?

By absolute value, below 1e11 is seconds, from 1e11 up to 1e14 is milliseconds, from 1e14 up to 1e17 is microseconds and 1e17 or more is nanoseconds. Every boundary is the same instant (the year 5138 in one unit, 1973 in the next finer one), so everyday dates never fall in an overlap. For an unusual value, such as a pre-1973 date given in milliseconds, pick the unit yourself. Nanosecond values exceed 2^53, so they are computed exactly with BigInt.

Which time zone is used when I turn a date into a timestamp?

The year, month, day, hour, minute and second you enter are read as wall-clock time in the selected zone, or in UTC if you press the UTC button. The same 2024-01-01 09:00:00 differs by 32,400 seconds (9 hours) between Seoul and UTC. If a free-text date carries its own offset or zone, such as +09:00, Z or [Asia/Seoul], that value wins.

Which date formats can the free-text box read?

ISO 8601/RFC 3339 (2026-10-04T15:05:00+09:00), RFC 9557 (a zone in brackets at the end), RFC 5322 (Sun, 04 Oct 2026 15:05:00 +0900), HTTP-date, and written dates in Korean or English such as Oct 4, 2026 3:05 PM, 4 October 2026 or 2026년 10월 4일 오후 3시 5분. Numeric forms like 2026/10/04 work as well. The format it picked is shown right below, and a failure comes with a reason.

Does the year 2038 problem affect this tool?

No. A signed 32-bit integer runs out on 2038-01-19, but this tool uses JavaScript numbers and handles dates up to about the year 275760. Whether the system you feed the value into uses 32 bits is a separate question.

How are leap seconds handled?

Unix time does not count them; every day has exactly 86,400 seconds, and around a leap second the same timestamp can appear twice. JavaScript Date follows the same rule, so it cannot represent 23:59:60, and this tool rejects 60 as a second.

Is anything I type sent to a server?

No. Every calculation uses the browser Date, Intl and BigInt; nothing is uploaded.

Missing a tool?