Epoch Converter Guide: Unix Units, UTC, Local Time and Rounding
Admin ·
ToolMellow’s Unix timestamp converter turns an epoch number or a written date into Unix seconds, Unix milliseconds, an ISO UTC string and readable dates in UTC and your browser’s time zone. Paste a value and choose Convert, or press Enter. Use the current time fills and converts a snapshot from your device clock.
The numeric unit is inferred from magnitude, rather than supplied by the input itself. Results round to milliseconds after JavaScript number conversion. Check the reported unit and resulting date before copying: a readable result can still come from an unintended unit, an ambiguous date or an inaccurate device clock.
Convert one value, then check what the result means
The workspace starts empty. Convert is disabled for empty or whitespace-only input. Enter still invokes conversion, so pressing it on an empty field produces the missing-input message. The field is left-to-right in every language and accepts up to 64 UTF-16 code units, which are not always the same as visible characters.
Start with 1516239022: the reported unit is seconds and the ISO result is 2018-01-18T01:30:22.000Z. For a written date, try 2026-10-01T12:00:00Z. Confirm the unit label, UTC date and any relevant local-time difference before choosing one of the six Copy buttons.
- Paste one epoch value or one written date; no file or batch input is provided.
- Choose Convert or press Enter, then check the reported interpretation and date.
- Copy the particular output row required by your receiving system.
Unix time describes an instant relative to an epoch
The Unix epoch is 1970-01-01T00:00:00Z. Unix time usually counts seconds from that instant without separately counting leap seconds. A timestamp does not contain a display time zone: the same instant can be shown as different local dates and clock times.
Milliseconds, microseconds and nanoseconds use progressively smaller units, but a plain number does not say which unit its producer intended. A JavaScript Date uses milliseconds. When comparing a log entry, database field or API value, check that system’s documented epoch and unit; a GPS, spreadsheet or other epoch value is not automatically Unix time.
MDN: Date, epochs, time zones and daylight-saving transitionsECMAScript: Date time values, range and date-time interpretation
Plain decimal numbers take the numeric path
Outer whitespace is trimmed. The numeric path accepts ASCII digits, an optional leading + or -, and an optional decimal fraction with digits on both sides of the point. For example, 0.5 is a numeric value. Localized grouping separators, exponent notation and alternate numeral systems are not part of this numeric grammar.
Other text goes to the browser’s date parser. That means a string outside the numeric grammar is not necessarily rejected: forms such as .5 or 1. can be interpreted as dates by some engines. Use an ungrouped decimal for epoch input and an explicit date-time with an offset for a written instant. A bare 2026 takes the numeric path and means seconds after the epoch, rather than the year 2026.
How seconds, milliseconds, microseconds and nanoseconds are inferred
The input first becomes a JavaScript Number. The converter then compares its absolute value with fixed thresholds, so a leading minus sign does not force a large value into the seconds branch. The table describes those comparisons on the represented number, before rounding the final milliseconds.
This is a heuristic, not a unit detector that knows your source system. 1000 is read as seconds even if you intended milliseconds. At a threshold the interpretation changes sharply: 99999999999 is seconds, while 100000000000 is milliseconds. There is no unit selector; confirm the Read as label and use a clearly specified written date when the inferred unit does not match your intended instant.
| Absolute value after Number conversion | Inferred unit | Conversion before rounding |
|---|---|---|
Below 100000000000 | Seconds | Multiply by 1000 |
Otherwise below 100000000000000 | Milliseconds | Keep the value |
Otherwise below 100000000000000000 | Microseconds | Divide by 1000 |
| Otherwise | Nanoseconds | Divide by 1000000 |
Fine input units do not guarantee fine output precision
The calculation uses JavaScript Number arithmetic, not arbitrary-precision integer arithmetic. Some large decimal integers cannot be represented exactly before unit inference even begins. For example, input 99999999999999999 becomes 100000000000000000 as a Number and reaches the nanoseconds branch. Counting the original digits alone cannot explain every boundary result.
After scaling, the result is rounded to the nearest millisecond with ties toward positive infinity. The microsecond input 1516239022123456 and nanosecond input 1516239022123456789 both produce 1516239022123 milliseconds here. The page does not output microseconds or nanoseconds, preserve their original precision, or provide a lossless round trip for every large input. Keep the original source value when finer precision matters.
MDN: Number.MAX_SAFE_INTEGER and numeric precisionMDN: Math.round and negative rounding ties
Negative values and fractional seconds need two rounding rules
A negative timestamp represents an instant before the epoch. The sign remains in the calculation while absolute magnitude chooses the unit. For example, -86400 is seconds and refers to the previous UTC day. Negative values are not limited to the seconds branch; sufficiently large negative magnitudes can be read as milliseconds, microseconds or nanoseconds.
The millisecond result is rounded first; the Unix seconds row then uses floor division by 1000. Input 0.0005 seconds rounds to 1 millisecond, while -0.0005 rounds to zero and -0.0006 rounds to -1 millisecond. That last instant has Unix seconds -1 and ISO output 1969-12-31T23:59:59.999Z. These rows express the rounded instant at different resolutions.
Use an explicit UTC marker or numeric offset
For an unambiguous written instant, use a date-time such as 2026-10-01T12:00:00Z. The Z marks UTC. An explicit offset also works: 2026-10-01T12:00:00+05:30 converts to 2026-10-01T06:30:00.000Z. The offset describes how that wall-clock value relates to UTC.
The ISO output is a normalized UTC representation; it does not retain the original offset spelling or a named time-zone rule. The workspace uses the browser’s Date parser, so it is not a validator for every ISO 8601 or RFC 3339 form. Accepted text also does not prove that any special source-format semantics have been preserved.
MDN: Date.parse formats, defaults and browser differencesMDN: Date.toISOString and UTC outputIETF RFC 3339: Internet timestamps and UTC offsets
A missing time zone has two different defaults
A standard date-only string such as 2026-10-01 is interpreted at midnight UTC. A standard date-time without an offset, such as 2026-10-01T12:00:00, uses the browser’s local time zone. Changing the website language changes presentation, not the underlying browser time-zone setting.
The table uses a browser in Asia/Kolkata to make the difference concrete. It is a worked example, not a selectable zone in this tool. Your time zone row names the browser’s zone next to the formatted date; there is no separate input-zone or output-zone picker.
| Written input | Interpretation | UTC output in the example |
|---|---|---|
2026-10-01 | Date-only, midnight UTC | 2026-10-01T00:00:00.000Z |
2026-10-01T12:00:00 | Local date-time in Asia/Kolkata | 2026-10-01T06:30:00.000Z |
2026-10-01T12:00:00Z | Explicit UTC date-time | 2026-10-01T12:00:00.000Z |
MDN: Date.parse formats, defaults and browser differencesMDN: Intl.DateTimeFormat, time zones and eras
Daylight-saving gaps and repeated times can change the interpretation
A local clock time can be skipped when the offset moves forward, or occur twice when it moves back. JavaScript’s local-time handling advances through a gap and chooses the earlier instant in an overlap. This page offers no ambiguity selector or scheduling rule; it uses the browser’s behavior and time-zone data.
In an America/New_York browser, 2026-03-08T02:30:00 is a gap example and converts to 2026-03-08T07:30:00.000Z. The repeated time 2026-11-01T01:30:00 selects 2026-11-01T05:30:00.000Z. An explicit offset identifies which instant you mean. For recurring events or historical local times, use a system that maintains the relevant zone rules and event policy.
MDN: Date, epochs, time zones and daylight-saving transitionsMDN: Date.parse formats, defaults and browser differences
Choose the representation your next step needs
All six rows come from the same rounded millisecond result. The technical numeric and ISO rows are left-to-right even on right-to-left pages. UTC and Your time zone use localized browser formatting; their displayed date and time omit subsecond detail, so use Unix milliseconds or ISO output when those digits matter.
Each row has its own Copy button. Unix seconds is useful only where the receiving system expects whole seconds, while Unix milliseconds retains the page’s rounded millisecond result. The relative label is a reading aid, rather than a durable interchange format.
| Row | What it shows | Useful boundary |
|---|---|---|
| Unix seconds | Rounded millisecond instant expressed as floored whole seconds | Subsecond detail is omitted |
| Unix milliseconds | The rounded integer millisecond result | Original finer precision may already be lost |
| ISO 8601 (UTC) | UTC date-time ending in Z | Original offset spelling is not retained |
| UTC | Localized date and clock time in UTC | Subsecond digits are omitted |
| Your time zone | Localized date and clock time, plus the browser’s zone name | No arbitrary zone selector |
| From now | Approximate past or future distance from the device clock | Not an exact duration or a running countdown |
MDN: Intl.DateTimeFormat, time zones and erasMDN: Date.toISOString and UTC output
Supported dates extend beyond 2038, with explicit BCE eras
JavaScript Date supports time values from -8640000000000000 through 8640000000000000 milliseconds. Written-date examples at the endpoints are -271821-04-20T00:00:00.000Z and +275760-09-13T00:00:00.000Z. Numeric input still passes through magnitude inference, so pasting one of those millisecond limits as a bare number does not explicitly select milliseconds.
ISO year 0000 corresponds to 1 BCE in this calendar, and -000001 to 2 BCE. The readable UTC and local rows include a localized era for BCE dates; UTC and local dates can fall on opposite sides of a year boundary. This supported range is not a promise about another system’s storage, historical calendar conventions or time-zone data. The familiar 2038 boundary concerns signed 32-bit Unix-second representations, not a universal end of Unix time.
MDN: Date, epochs, time zones and daylight-saving transitionsECMAScript: Date time values, range and date-time interpretationMDN: Intl.DateTimeFormat, time zones and eras
From now is an approximate comparison with the device clock
From now chooses the largest fitting unit among years, months, days, hours, minutes and seconds, then rounds the quantity. The year uses 365.25 days and the month 30.4375 days. Those fixed lengths are convenient approximations; they are not calendar-aware month arithmetic or a count of local dates crossed.
The text can describe the past or the future and depends on your device clock. There is no automatic timer. The label is recomputed when the component renders, so editing input or another state-changing action can refresh it while retaining the same converted instant. Use the numeric or ISO row for an exact stored representation of that rounded instant.
Current time is a snapshot, and editing is separate from converting
Use the current time fills the input with the device clock’s whole Unix seconds and converts immediately. It is not synchronized to an independent time service, and it does not keep ticking. If the device clock is wrong, the snapshot and relative comparison can be wrong too.
Editing the input preserves the previous result, error and copy notice until another action changes them. Copy therefore acts on the displayed result, which can differ from the newly edited input. A successful conversion replaces the result and clears the error; a failed conversion removes the result. There is no Clear control, and deleting the input alone does not remove old output. Reloading resets this workspace.
Conversion stays in the page; copying creates a separate copy
The conversion code processes the entered value in your browser rather than submitting it to a conversion endpoint. Loading the site still involves normal page and asset requests, and a local calculation does not make the page permanently available without a connection.
Copy writes the selected row to the clipboard when permitted. If the write is unavailable, select the visible value and copy it manually. Editing input, converting again or reloading does not erase clipboard contents or copies pasted elsewhere. This workspace has no file export, batch download, saved history or automatic handoff to another tool.
A conversion result is not full calendar validation
Empty input and unsupported or out-of-range values receive error messages. Other text can be normalized or interpreted differently across browsers. An invalid-looking calendar date may move into another month instead of producing an error; a nonstandard date spelling may work in one environment and fail in another.
If a result is surprising, check the original unit, reported unit, sign, decimal point, year, UTC offset and browser zone. Compare the ISO UTC row with your intended instant. Prefer a standard date-time with an explicit offset, and use a dedicated validator when your workflow requires rejecting every invalid calendar or interchange-format value.
MDN: Date.parse formats, defaults and browser differencesIETF RFC 3339: Internet timestamps and UTC offsets
Use this page for one conversion with a known context
This converter is useful for reading a log timestamp, checking an API example or translating one written instant into the seconds or milliseconds a system expects. It does not provide a user-selected unit, arbitrary output zone, duration calculator, recurring-event scheduler, Discord timestamp formatter or alternate-epoch conversion.
JWT Decoder can inspect a token’s numeric time claims, and JSON Formatter can help read surrounding structured data. Those are separate tools; no input is transferred automatically. Preserve the original source value and its documented unit when precision or later investigation matters.
Common questions
What is a Unix timestamp?
It usually means seconds since 1970-01-01T00:00:00Z, without separately counting leap seconds. Many systems use milliseconds or finer units instead, so confirm the producer’s documented unit and epoch.
How does the converter choose seconds or milliseconds?
It converts numeric input to a JavaScript Number and compares the absolute value with fixed thresholds. The result names the inferred unit. There is no manual unit selector, and the heuristic may differ from what the source system intended.
Why is my timestamp showing a date near 1970?
The inferred unit may not match your intended unit. Small numeric values are treated as seconds; even a bare year such as 2026 is a number of seconds after the epoch. Check the unit label and use a clear written date-time where appropriate.
Can nanosecond input keep nanosecond precision?
No. Number conversion can lose precision before scaling, and the final result is rounded to milliseconds. Only whole Unix seconds and integer milliseconds are provided as numeric output; no microsecond or nanosecond output is offered.
Does a date without a time zone mean UTC?
A standard date-only string defaults to midnight UTC. A standard date-time without an offset uses the browser’s local zone. Include Z or an explicit numeric offset when you need a specified instant.
How do negative Unix timestamps work?
They represent instants before the epoch. Absolute magnitude determines the inferred unit. The converter rounds milliseconds first, then floors the Unix seconds output, so negative fractional seconds need care.
What happens during a daylight saving time change?
A local clock time can be skipped or repeated. The browser’s JavaScript handling moves through a gap and chooses the earlier instant in an overlap. This page has no ambiguity selector; an explicit offset identifies the intended instant.
Why can an invalid-looking date still convert?
The browser parser can normalize calendar fields or interpret nonstandard strings. A result is not proof of strict ISO 8601, RFC 3339 or calendar validation. Check the resulting UTC instant and use a dedicated validator when required.
Can I copy a timestamp without uploading it?
Conversion runs in the page without a conversion upload. Each output row has an intentional Copy action. Normal page requests still occur, and copying places the selected value outside the workspace on the clipboard.
Can I choose a different time zone?
There is no zone picker. The page shows UTC and your browser’s current zone. For input, a standard written date-time can carry an explicit UTC offset.
Why does changing input leave the old result visible?
Input editing and conversion are separate. The previous result, error and notice remain until another action changes them. Copy uses the displayed result, so convert again before copying edited input.
Does Use the current time provide a live, synchronized clock?
No. It takes one snapshot of the device clock at whole-second resolution and converts it. The page has no independent synchronization or continuously updating clock.
What do BCE years mean in the output?
ISO year 0000 corresponds to 1 BCE, and -000001 to 2 BCE in the calendar used here. Readable BCE dates include a localized era. UTC and local representations may show different calendar dates for the same instant.
What are the input and output limits?
The input field accepts up to 64 UTF-16 code units. Values must fit JavaScript’s supported Date range after interpretation. Output has millisecond resolution after Number arithmetic and rounding; there is no batch, file import or download.
Sources and further reading
- ECMAScript: Date time values, range and date-time interpretation
- MDN: Date, epochs, time zones and daylight-saving transitions
- MDN: Date.parse formats, defaults and browser differences
- MDN: Number.MAX_SAFE_INTEGER and numeric precision
- MDN: Math.round and negative rounding ties
- IETF RFC 3339: Internet timestamps and UTC offsets
- MDN: Intl.DateTimeFormat, time zones and eras
- MDN: Intl.RelativeTimeFormat and localized relative labels
- MDN: Date.toISOString and UTC output
- MDN: Clipboard.writeText and unavailable writes
- MDN: maxlength and UTF-16 code-unit limits