molecalculator

Moles & Molar Mass

Epoch Calculator: Convert Unix Timestamps Online

Calculator No. 01-2438 · 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 online epoch calculator converts a Unix timestamp—the number of seconds or milliseconds counted from a fixed starting point—into a readable date and time, or converts a date and time into an epoch value. Enter a timestamp or a calendar date, choose the correct unit and time zone, and check the converted result before using it in code or data.

Formula

A Unix timestamp is an elapsed time from the Unix epoch, 1970-01-01 00:00:00 UTC. To convert it to elapsed seconds, multiply the entered value by its unit factor; then interpret those seconds from the epoch:

Elapsed seconds = t × u

  • t is the entered timestamp, in seconds or milliseconds.
  • u is the seconds-per-unit factor: 1 for seconds, or 0.001 for milliseconds.
  • The date-time output represents that elapsed duration on the UTC timeline. The calculator’s second output is milliseconds, calculated as t × u × 1000.

The specification’s timestamp input is in seconds by default. Choose 0.001 for a timestamp in milliseconds; the unit selector accepts numeric values from 0.000001 through 1, so select one of the stated conventional factors rather than treating it as a free-form unit converter. A date-time display requires calendar formatting, which is distinct from the arithmetic that produces elapsed seconds.

Worked Example

Using the defaults, the entered timestamp is 1,700,000,000 seconds and the unit factor is 1 second per second.

  1. Elapsed seconds = 1,700,000,000 × 1 = 1,700,000,000 seconds.
  2. That instant is 2023-11-14 22:13:20 UTC.
  3. Milliseconds = 1,700,000,000 × 1 × 1,000 = 1,700,000,000,000 ms.

The displayed date and time is UTC, not the viewer’s local time. If the same timestamp were entered as milliseconds, choose 0.001: 1,700,000,000,000 × 0.001 = 1,700,000,000 seconds, giving the same instant.

What an Epoch Calculator Is For

Unix time is a convenient way for computers to represent instants as numbers. It is widely used in programming languages, databases, APIs, log files, and data-processing systems. A number such as 1,700,000,000 is compact and easy to compare or subtract; a date such as 2023-11-14 22:13:20 UTC is easier for a person to interpret.

An epoch calculator helps when you need to inspect a value copied from a system, check whether two events are seconds or milliseconds apart, or translate a known date into a numeric timestamp. It is also useful for spotting a common data issue: a value that looks far too large for seconds may actually be milliseconds.

How to Convert a Date to an Epoch Value

For a date-to-timestamp conversion, the calculation runs in the opposite direction. First identify the exact date and time, including its time zone. Convert that local time to UTC, then count the elapsed seconds since 1970-01-01 00:00:00 UTC. For milliseconds, multiply the seconds value by 1,000.

  • Enter a complete date and time, not just a date, if the time of day matters.
  • Specify the applicable time zone or UTC offset. For example, noon in a local zone is not necessarily noon UTC.
  • Choose seconds or milliseconds to match the system that will consume the result.
  • Retain enough precision if fractional seconds are important to your application.

The calculator block above is configured for converting a numeric timestamp to a UTC instant. If you need to convert a calendar date into a timestamp, use a calculator that provides date and time fields, or a programming-language date-time library that accepts an explicit time zone.

Seconds, Milliseconds, and Time Zones

Seconds and milliseconds are the two most common Unix timestamp units, but a timestamp’s size alone is only a clue, not proof. A timestamp of 1,700,000,000 is plausible in seconds for a modern date; 1,700,000,000,000 is plausible in milliseconds for the same instant. Some systems use microseconds or nanoseconds, so check the source’s documentation rather than guessing.

Unix timestamps describe elapsed time relative to UTC, not a local wall-clock reading. The same instant can display as different clock times in different time zones. Daylight-saving changes affect local clock labels and offsets, not the underlying instant. When comparing timestamps from different sources, normalize the displayed times to UTC and verify that both sources use the same unit and precision.

Common Errors and Limitations

  • Mixing up seconds and milliseconds: a factor-of-1,000 error can shift a result dramatically. Confirm the unit in the source system.
  • Ignoring the time zone: a date entered without an offset can be interpreted differently by different tools.
  • Confusing an instant with a calendar date: a timestamp identifies a moment; displaying that moment as a local date requires a time zone.
  • Rounding away precision: whole seconds cannot preserve milliseconds or finer fractions. Keep the original precision if it matters.
  • Assuming every system uses Unix time: some formats count from another epoch, store local dates, or use a different time scale.

Traditional Unix time does not represent leap seconds as distinct, separately countable seconds in the ordinary way. Applications requiring precise scientific or specialized timekeeping may need a time scale and library designed for that purpose. Also check supported date ranges: software, databases, and file formats can impose limits even when the underlying arithmetic is straightforward.

Frequently Asked Questions

What is the Unix epoch date?
The Unix epoch is 1970-01-01 00:00:00 UTC. A Unix timestamp measures elapsed time from that reference point, usually in seconds or milliseconds.

How do I tell whether a timestamp is in seconds or milliseconds?
Check the field name or documentation first. Magnitude can offer a hint—modern timestamps in milliseconds are typically about 1,000 times their seconds equivalents—but it is not a reliable substitute for confirming the format.

Why does my timestamp show a different time on another device?
The devices may be displaying the same instant in different local time zones. Compare the UTC values, or make sure both displays use the same time-zone setting.

Can I convert a date to a Unix timestamp?
Yes. Specify the date, clock time, and time zone, convert the instant to UTC, then count seconds since the Unix epoch. Multiply by 1,000 if the desired output is milliseconds.

Are Unix timestamps always UTC?
A Unix timestamp represents an instant on the UTC-based timeline; it does not contain a local time zone. A time zone is needed to render that instant as a local calendar date and clock time.

Related

Formula used
in t | Unix timestamp | s | 1700000000 | 0
in u | Timestamp unit: seconds=1, milliseconds=0.001 | - | 1 | 0.000001 | 1
out d | Unix date and time in UTC | - | t * u | 0
out ms | Timestamp in milliseconds | ms | t * u * 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 →