molecalculator

Moles & Molar Mass

Epoch Calculator: Convert Unix Timestamps to Dates

Calculator No. 01-2440 · Updated · Formula and assumptions shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

An epoch calculator converts a Unix timestamp—a count of seconds or milliseconds from a fixed starting point—into a readable date and time, or converts a date and time back into a timestamp. Enter a value and its unit, or select a date and time with a time zone, to see the equivalent representation; the conversion is arithmetic, but the displayed calendar time depends on the chosen zone.

Formula

This calculator treats the input as a Unix timestamp measured in seconds. Its first result is the same timestamp in seconds; the second expresses that count in milliseconds:

  • Seconds: ts = ts
  • Milliseconds: tms = ts × 1,000

Here, ts is the entered Unix timestamp in seconds, ts is the same value in seconds, and tms is the equivalent value in milliseconds. This block does not derive a calendar date, because a date-time display also needs a calendar and a time-zone convention. To convert a timestamp to a date, interpret the elapsed seconds from 1970-01-01 00:00:00 UTC, then display the instant in UTC or in the chosen local time zone. For the reverse conversion, measure elapsed seconds from that UTC starting point.

Worked Example

Using the default input, ts = 1,700,000,000 s:

  1. Seconds since the epoch: 1,700,000,000 s.
  2. Convert seconds to milliseconds: 1,700,000,000 × 1,000 = 1,700,000,000,000 ms.

The timestamp corresponds to 2023-11-14 22:13:20 UTC. A local-time display can show a different clock time or even a different calendar date, while still representing the same instant.

Assumptions

  • The timestamp uses the Unix convention: seconds counted from 1970-01-01 00:00:00 UTC.
  • The input is in seconds, not milliseconds, microseconds, or nanoseconds.
  • Calendar rendering uses a Gregorian calendar and an explicitly selected time zone.
  • Unix time generally does not represent leap seconds as distinct timestamp values.

What an Epoch Calculator Does

“Epoch” means a reference point from which time is counted. In computing, “Unix epoch” usually refers to midnight at the beginning of 1970 in Coordinated Universal Time (UTC). A Unix timestamp is the numerical distance from that reference, commonly expressed in seconds. It is useful because software can compare, sort, store, or subtract timestamps without first handling month names, local clock formats, or daylight-saving changes.

The word “epoch” is not exclusive to Unix. Different systems and file formats can define different starting dates, units, or interpretations. A number alone does not establish which convention is intended. Check the data source or field documentation before converting an unfamiliar timestamp.

How to Read Timestamp Units

Seconds are a common Unix timestamp unit, but many programming environments and data services use milliseconds. A value of 1,700,000,000 seconds and a value of 1,700,000,000 milliseconds describe very different dates. The latter is only 1,700,000 seconds after the Unix epoch, roughly 19.7 days; the former is in 2023.

  • Seconds: commonly about 10 digits for present-day dates.
  • Milliseconds: commonly about 13 digits for present-day dates.
  • Microseconds: commonly about 16 digits.
  • Nanoseconds: commonly about 19 digits.

These digit counts are clues, not proof. Negative timestamps can represent instants before 1970, and systems may use fractional seconds or other units. If a converted date is implausibly far in the past or future, verify the unit and epoch before assuming the value itself is wrong.

Time Zones, Dates, and Common Mistakes

A timestamp identifies an instant; a time zone determines how that instant appears on a local clock. UTC is the clearest reference for comparing values across locations. For example, 2023-11-14 22:13:20 UTC is 2023-11-14 14:13:20 in a location observing UTC−8 at that instant. The numeric timestamp itself has not changed.

  • Mixing up seconds and milliseconds: confirm the field’s documented unit before entering a value.
  • Confusing UTC with local time: record the zone or UTC offset when converting a human-entered date into a timestamp.
  • Ignoring daylight-saving rules: a local date and clock time may be ambiguous or nonexistent near a clock change. A named time zone and date are more informative than a fixed offset alone.
  • Rounding too early: retain fractional seconds if subsecond precision matters; round only for the display or application that requires it.
  • Assuming all systems have the same range: software libraries, databases, and file formats may limit the dates or precision they can represent.

A related misconception is that Unix timestamps include a separate number for every leap second. Traditional Unix time does not provide a unique timestamp for each leap second in that way. If precise scientific timekeeping is needed, determine whether the source uses UTC, a continuous time scale, or a system-specific convention rather than relying on a generic epoch conversion.

When to Use an Epoch Calculator

An epoch calculator is useful when inspecting logs, debugging APIs, comparing event times, or translating a timestamp copied from software into a human-readable date. It can also help when preparing a timestamp for a system that expects seconds or milliseconds. For a reliable conversion, note these details alongside the result:

  • The epoch or time standard used by the source.
  • The input unit and any fractional precision.
  • The output time zone, preferably UTC when sharing or comparing records.
  • Any range or date-format limits imposed by the software receiving the value.

For routine calendar planning, a calendar or date-time tool that handles named time zones and daylight-saving rules is often more suitable than manually adding an offset. For reproducible data analysis, keep the original timestamp as well as its formatted date, so another person can check the conversion.

Frequently Asked Questions

What is the Unix epoch?
The Unix epoch is the reference instant 1970-01-01 00:00:00 UTC. A Unix timestamp commonly counts seconds elapsed from that point.

How do I tell whether a timestamp is in seconds or milliseconds?
Check the documentation first. The number of digits can provide a rough clue for contemporary dates—often 10 for seconds and 13 for milliseconds—but it is not a dependable substitute for knowing the source’s convention.

Can an epoch timestamp be negative?
Yes. Under the Unix convention, a negative value can indicate an instant before 1970-01-01 00:00:00 UTC. Not every tool or data format supports the same historical range.

Does a timestamp change when I convert it to local time?
No. The instant remains the same; only its calendar and clock representation changes with the selected time zone and applicable daylight-saving rules.

Are epoch seconds and Unix time exactly the same?
People often use the terms interchangeably, but check the context: Unix timestamps are commonly seconds, while some systems store milliseconds or use another epoch or time scale. Confirm both the starting point and unit.

Related

Formula used
in ts | Unix timestamp | s | 1700000000 | 0
out dt | Seconds since Unix epoch | s | ts | 0
out ms | Milliseconds since Unix epoch | ms | ts * 1000 | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.

More in this section

The whole Moles & Molar Mass section →