An epoch calculator timestamp converts a date and time to a number measured from a defined starting point, or converts that number back into a readable date and time. Enter a timestamp in seconds or milliseconds, or provide a date and time, to get the corresponding value in the other format; this calculator uses the Unix epoch in UTC.
Formula
A Unix timestamp is the elapsed time since 1970-01-01 00:00:00 UTC. For a date and time after the epoch, the timestamp in seconds is:
t = elapsed seconds since 1970-01-01 00:00:00 UTC
For a timestamp expressed in milliseconds, convert it to seconds by dividing by 1,000. The reverse conversion is milliseconds = seconds × 1,000. Here, t is the timestamp in seconds; the calculator’s input ts is the supplied timestamp; and unit is 1 for seconds or 1,000 for milliseconds. The first output displays the corresponding date and time in UTC.
A date-time result cannot be represented as an ordinary numeric expression alone: the calculator formats the computed elapsed-time value as a UTC calendar date and time. The selected unit is essential because a timestamp such as 1,700,000,000 is a plausible number of seconds, while the same number interpreted as milliseconds represents a date in 1970.
Worked Example
The calculator’s default input is 0 seconds. The epoch is the starting point, so:
t = 0 / 1 = 0 seconds
Zero seconds after 1970-01-01 00:00:00 UTC is 1970-01-01 00:00:00 UTC.
Assumptions
- The epoch is the Unix epoch: 1970-01-01 00:00:00 UTC.
- The selected unit is applied to the input before it is interpreted.
- The result is displayed in UTC, not the computer’s local time zone.
- Unix time does not count leap seconds as separate timestamp values.
What an Epoch Timestamp Means
An epoch is a reference point from which a system counts elapsed time. “Epoch timestamp” most often means Unix time, also called POSIX time: a count of seconds from midnight at the start of January 1, 1970, in Coordinated Universal Time (UTC). For dates before that starting point, timestamps are negative. For example, one second before the epoch is −1.
The phrase can be ambiguous because different software and technical systems may use another epoch, unit, or time scale. Some systems count milliseconds, microseconds, or nanoseconds rather than seconds; others define a different starting date. Before converting a number, identify both the epoch and the unit. A value without those details is not enough to determine a date reliably.
How to Read Seconds and Milliseconds
Unix timestamps are commonly written in seconds or milliseconds. Milliseconds are thousandths of a second, so there are 1,000 milliseconds in a second. The number of digits can offer a clue, but it is not a dependable substitute for documentation: older or future dates, rounded values, and other units can make guesses misleading.
- Seconds: 1,700,000,000 seconds is approximately 2023-11-14 22:13:20 UTC.
- Milliseconds: 1,700,000,000,000 milliseconds represents the same instant, because dividing by 1,000 gives 1,700,000,000 seconds.
- Microseconds: These are millionths of a second. A microsecond timestamp must be divided by 1,000,000 to obtain seconds; do not select milliseconds for it.
The first example is approximate only to identify the calendar date and time; precise display and supported date range can depend on the calculator or programming environment. The key conversion remains the unit factor.
UTC, Local Time, and Date Formatting
UTC provides a consistent reference across locations. A timestamp identifies an instant; a time zone determines how that instant appears on a local clock. For example, the same UTC instant can correspond to different calendar dates in distant time zones. This is why a timestamp converted by one tool may appear hours earlier or later than a date shown on a device set to local time, even when both refer to the same instant.
When comparing a converted result with a calendar entry, check whether each is in UTC or local time and whether daylight-saving rules apply. UTC itself does not shift for daylight saving. For software, exchanging timestamps alongside an explicit UTC indicator or time-zone offset prevents many misunderstandings.
Common Errors and Limits
- Choosing the wrong unit: Treating milliseconds as seconds makes the interpreted date far too far in the future; treating seconds as milliseconds puts it near 1970.
- Confusing a date with an instant: A date-time without a time zone may not identify one unique moment. Include UTC or a valid offset when converting.
- Assuming every epoch is Unix: Check the system’s documentation for its origin and unit, especially for file formats, devices, and specialized software.
- Expecting leap-second precision: Traditional Unix timestamps do not assign a separate count to every leap second. Systems that need precise time-scale handling may use specialized representations.
- Ignoring range and precision: Some software has limits on dates it can represent, and floating-point numbers can lose precision for extremely large values or subsecond timestamps.
For ordinary date conversion, the Unix timestamp is convenient and widely supported. It is not a complete description of calendar conventions or time-zone rules: those must be handled by the software that formats the timestamp.
Frequently Asked Questions
What is the Unix epoch date?
The Unix epoch is 1970-01-01 00:00:00 UTC. Unix timestamps count elapsed time from that reference point, usually in seconds.
How do I tell whether a timestamp is in seconds or milliseconds?
Check the source’s documentation or field definition first. The number of digits can be a rough hint, but it is not definitive. Confirm by converting with the intended unit and checking whether the date is plausible.
Can a Unix timestamp be negative?
Yes. Negative values represent instants before 1970-01-01 00:00:00 UTC. For example, −86,400 seconds is one day before the epoch.
Does a Unix timestamp change with my time zone?
No. The timestamp represents an instant. Its displayed clock time changes when formatted for a different time zone, but the underlying instant does not.
Are Unix timestamps affected by leap years?
They still map to calendar dates that include leap days, but the timestamp itself counts seconds rather than numbering calendar days. Unix/POSIX time also does not represent leap seconds as separate seconds.
Is an epoch timestamp always measured in seconds?
No. Seconds are common, but many data sources use milliseconds, microseconds, or nanoseconds. Confirm the unit before converting or comparing values.
Related
Formula used
in ts | Unix timestamp | s | 0 | - sel unit | Timestamp unit | Seconds=1, Milliseconds=1000 out date | Unix epoch date and time | UTC date-time | ts / unit | 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
- MD Calc I:T Ratio Calculator and Explanation0.0500 ratio
- Oxygen Mass Number: Isotope Values Explained16 nucleons
- Mass-to-Light Ratio: Meaning and Calculation1.000 M☉/L☉
- M/z Ratio in Mass Spectrometry: Meaning and Calculation1,000.00 Th
- Mass Fraction to Molar Fraction Calculator
- K2 Molar Mass Calculator and Calculation78.1966 g/mol