molecalculator

Moles & Molar Mass

Epoch Calculator Converter: Unix Time Explained

Calculator No. 01-2436 · 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 converter changes a timestamp into a human-readable date and time, or converts a date and time into an epoch timestamp. Enter the timestamp or calendar date, choose the time unit and time zone, and the converter returns the equivalent value.

Formula

This page calculates the Unix timestamp in seconds and milliseconds from an entered timestamp and unit. It does not convert the calendar-date fields into a timestamp: those fields illustrate how a UTC date is specified, while the calculator outputs are based on the timestamp input.

  • Unix timestamp (s) = t × u
  • Unix timestamp (ms) = t × u × 1,000

t is the entered timestamp in the unit chosen. u is the selected unit’s scale in seconds: 1 for seconds, 0.001 for milliseconds, 0.000001 for microseconds, or 0.000000001 for nanoseconds. The second output multiplies seconds by 1,000 to express the same instant in milliseconds. For the date-and-time form, a full calendar converter would also need to calculate elapsed days since the epoch, including leap years; these output expressions do not perform that calculation.

Worked Example

Using the default timestamp, 1,735,689,600 seconds, and the default unit, Seconds=1:

  • Seconds: 1,735,689,600 × 1 = 1,735,689,600 s.
  • Milliseconds: 1,735,689,600 × 1 × 1,000 = 1,735,689,600,000 ms.

The timestamp corresponds to 2025-01-01 00:00:00 UTC. The calculation changes units; the date interpretation follows the Unix time convention.

Assumptions

  • The timestamp follows the Unix convention: seconds measured from 1970-01-01 00:00:00 UTC.
  • The selected unit is correct and the timestamp is a valid numeric value.
  • The conversion is arithmetic only; it does not account for leap seconds.
  • The calendar fields are not inputs to the timestamp calculation.

What an Epoch Timestamp Means

An epoch is a reference point from which time is counted. In most software contexts, “epoch time” or “Unix time” means the number of seconds since 1970-01-01 at midnight UTC. A timestamp can be positive for a later instant or negative for an earlier one. Some systems store the count in milliseconds, microseconds, or nanoseconds instead, so the unit is essential.

For example, 1,735,689,600 seconds is the same instant as 1,735,689,600,000 milliseconds. The figures differ by a factor of 1,000, not by a difference in date. A converter must know the source unit before interpreting the number.

How to Convert Epoch Time

To turn a timestamp into a date, first convert it to seconds if necessary, then add that duration to the epoch reference point and display the resulting instant in a chosen time zone. To go the other way, calculate the elapsed seconds from the epoch to the desired instant. Millisecond output is the seconds value multiplied by 1,000.

  1. Check whether the input is in seconds, milliseconds, microseconds, or nanoseconds.
  2. Convert to seconds using the appropriate scale factor.
  3. Interpret the resulting instant relative to 1970-01-01 00:00:00 UTC.
  4. Choose a time zone for display. The underlying instant remains the same when its displayed local time changes.

A practical clue is the number of digits, but it is not conclusive: current Unix timestamps are around 10 digits in seconds and 13 digits in milliseconds. Older dates, future dates, and custom counters can have different lengths. Confirm the source system’s documentation rather than relying only on digit count.

UTC, Local Time, and Calendar Details

Unix timestamps describe instants, not local wall-clock readings. UTC is the common reference used to express that instant. A local display may differ by a time-zone offset and can also depend on daylight-saving rules. Thus, one timestamp can correctly display as different clock times in different places.

Calendar conversions must handle months of different lengths and leap years. The Gregorian calendar adds a leap day in years divisible by four, except century years unless divisible by 400. A proper converter uses calendar rules and a time-zone database; it should not approximate a year as exactly 365 days when converting a specific date.

Unix time conventionally counts seconds without representing leap seconds as distinct timestamp values. This is suitable for ordinary software date handling, but it is not identical to a precise physical-time scale. Systems that require specialized timing may use other standards or additional synchronization information.

Common Errors and Uses

  • Mixing up seconds and milliseconds: This can move the interpreted date far into the past or future. Check the unit first.
  • Confusing UTC with local time: A displayed hour can differ while both values refer to the same instant.
  • Using a timestamp as a calendar date: A timestamp is a count from an origin, not a year-month-day string.
  • Assuming unlimited range: Some software or data formats have limits based on their numeric representation, even though the general timestamp idea can express dates outside familiar application ranges.

Epoch values are common in logs, databases, APIs, file metadata, and program-generated records because a numeric count is easy to sort and compare. When investigating a record, retain the original value and unit, and note the time zone used for its human-readable display. Rounding fractional timestamps can discard subsecond detail, which matters in systems that compare events closely.

Frequently Asked Questions

What is the Unix epoch?
The Unix epoch is 1970-01-01 00:00:00 UTC, the reference point from which conventional Unix timestamps count seconds.

How do I convert milliseconds to seconds?
Divide the millisecond value by 1,000. For example, 1,735,689,600,000 ms ÷ 1,000 = 1,735,689,600 s.

Is epoch time always in UTC?
The timestamp represents an instant relative to the UTC-based Unix epoch. A converter may display that instant in UTC or another time zone.

Why does my timestamp show a date in 1970?
A common cause is treating milliseconds as seconds or seconds as milliseconds. Verify the unit expected by the application that created the value.

Can epoch timestamps be negative?
Yes. A negative Unix timestamp represents an instant before 1970-01-01 00:00:00 UTC, although support for such dates varies across software and formats.

Related

Formula used
in t | Epoch timestamp | s | 1735689600 | 0
sel u | Timestamp unit | Seconds=1, Milliseconds=0.001, Microseconds=0.000001, Nanoseconds=0.000000001
in y | Year | - | 2025 | 1 | 9999
in mo | Month | - | 1 | 1 | 12
in d | Day | - | 1 | 1 | 31
in h | Hour (UTC) | h | 0 | 0 | 23
in mi | Minute (UTC) | min | 0 | 0 | 59
in s | Second (UTC) | s | 0 | 0 | 59
out ts | Unix timestamp | s | t * u | 0
out ms | Unix timestamp | 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 →