Skip to main content
Calcimator

Unix Timestamp Converter

Convert between Unix timestamps and human-readable dates. Get the current Unix time or convert any date to a timestamp.

This calculator runs one of three separate code paths depending on Mode, and each path reads a different subset of the seven inputs. In Timestamp to Date mode (the default), only the Unix Timestamp field is read at all -- Year, Month, Day, Hour, and Minute are completely ignored, so changing any of them has zero effect on the result while Mode stays on this setting (lines 30-51). In Date to Timestamp mode, the calculator flips the other way: it builds the result entirely from Year, Month, Day, Hour, and Minute using UTC time explicitly (line 54), and the Unix Timestamp field you typed is ignored instead. Current Time mode reads none of the date fields; it just takes the machine's clock at the moment you run it (lines 23-29). Relative Time is built from its own set of hand-picked thresholds -- under a minute reports seconds, under an hour reports minutes, under a day reports hours, under 30 days reports days, under 365 days reports months, and beyond that reports years (lines 38-43) -- and that bucketing logic only runs in full in Timestamp to Date mode; Date to Timestamp mode uses a simpler version that only distinguishes "just now" from a plain day count (lines 58-61), so the same underlying time gap can be described with different granularity depending on which mode produced it. Timestamp (ms) is always the seconds-based Unix Timestamp multiplied by 1,000 (line 64), never computed independently. The calculator does not validate that Year, Month, Day, Hour, and Minute form a real calendar date before handing them to JavaScript's date construction -- an out-of-range value like a 31st day in a 30-day month rolls forward into the next month rather than being rejected.

Inputs

Results

Unix Timestamp

1,700,000,000

Timestamp (ms)1,700,000,000,000
UTC DateTue, 14 Nov 2023 22:13:20 GMT
ISO 86012023-11-14T22:13:20.000Z
Relative Time3 years ago
How to Use This Calculator
  1. Select the Mode: Current Time, Timestamp to Date, or Date to Timestamp.
  2. For Timestamp to Date mode, enter the Unix Timestamp (seconds since Jan 1, 1970 UTC).
  3. For Date to Timestamp mode, enter Year, Month, Day, Hour (UTC), and Minute.
  4. Review the Unix Timestamp, Timestamp in milliseconds, UTC Date, and ISO 8601 format.

How the result changes with Unix Timestamp

Unix TimestampUnix Timestamp
1,000,000,0001,000,000,000
3,500,000,0003,500,000,000
6,499,999,9996,499,999,999
8,999,999,9998,999,999,999

What each input means

Mode
Calculation mode to use.
Year
The year to check.
Month
Month of the year (1-12).
Hour (UTC)
Hour of the day (0-23).
Minute
Minute of the hour (0-59).

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Mode = 1, Unix Timestamp = 1700000000, Year = 2025, Month = 1 = 7 input(s) provided
  2. Calculate Unix Timestamp
    1700000000 = 1700000000
  3. Calculate Timestamp
    Timestamp
    1700000000000 = 1700000000000
  4. Calculate UTC Date
    Tue, 14 Nov 2023 22:13:20 GMT = Tue, 14 Nov 2023 22:13:20 GMT

Engine last updated . Checked against 2 independently-derived tests how we verify calculators.

Frequently Asked Questions

Why doesn't changing the Year, Month, or Day field do anything to my result?

It depends entirely on which Mode is selected. In Timestamp to Date mode -- the default -- the calculator reads only the Unix Timestamp field and ignores Year, Month, Day, Hour, and Minute completely (lines 30-51), so none of them can move the result while that mode is active. Switch to Date to Timestamp mode and those same fields become the ones that matter, while Unix Timestamp itself is ignored instead.

Does Date to Timestamp mode use my local time zone or UTC?

UTC, explicitly -- the calculator builds the date with Date.UTC() using the Year, Month, Day, Hour, and Minute you entered (line 54), rather than treating them as a local time and converting. If you intend a specific local time, you need to convert it to UTC yourself before entering the hour and minute.

Why does Relative Time sometimes say something like "3 days ago" and other times give a coarser answer?

Because the two modes that can produce a Relative Time figure use different logic. Timestamp to Date mode runs a full set of thresholds -- seconds, minutes, hours, days, months, or years, picked based on how large the gap is (lines 38-43) -- while Date to Timestamp mode uses a simpler version that only distinguishes "just now" from a plain day count (lines 58-61), so the same size gap can read differently depending on which mode generated it.

What happens if I enter an invalid date, like day 31 of a month that only has 30 days?

The calculator doesn't check whether the date is real before building it -- it passes your numbers straight into JavaScript's date construction, which rolls an out-of-range day forward into the next month rather than rejecting the input or showing an error. The resulting timestamp will correspond to that rolled-forward date, not the date you typed.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Time & Date.