Unix Timestamp Converter Widget

Embed a Unix timestamp converter with a live epoch clock. Readers convert a timestamp to UTC and local time - the widget recognises seconds, milliseconds, microseconds and nanoseconds - or turn a date and time back into a timestamp.

Developer Tools Converter Runs in your browser Free · no ads

Customize your widget

Theme
Auto follows the visitor's light/dark setting.
Style
Attribution on your page
Optional and entirely your choice. The exact line is shown in the code below; it links to the tool with rel="nofollow".
More options
Starting values
Leave blank to use the widget's defaults. Visitors can still change every value.

Live preview

Exactly what your visitors will see

Embed code

<iframe src="https://a2z.tools/embed/w/unix-timestamp-converter" title="Unix Timestamp Converter by A2Z Tools" width="100%" height="940" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>

A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.

Works with

How it works

The top card shows the current Unix time and updates every second (paused when the frame is hidden). For conversion, the unit is detected from the number of digits: up to 11 digits is seconds, 12-14 milliseconds, 15-16 microseconds and 17-19 nanoseconds, which reads every date from 1973 to 5138 as intended; the reader can force a unit. Long nanosecond values are divided with BigInt so no digits are lost first. The result is shown in ISO 8601 UTC, in the visitor's local zone and as a relative phrase. Going the other way, a date and time in local time or UTC gives seconds and milliseconds; a local time that is skipped by a daylight-saving jump is flagged.

Method

  • Unix time = seconds since 1970-01-01T00:00:00Z, ignoring leap seconds (POSIX)
  • Digits in the integer part: <=11 seconds, 12-14 ms, 15-16 us, 17-19 ns
  • ms = value x 1000 (s), value (ms), floor(value / 1000) (us), floor(value / 1,000,000) (ns)
  • Valid range: +/-8.64e15 ms (about 271,821 BC to 275,760 AD)
  • UTC output: ISO 8601 extended format with milliseconds and Z (RFC 3339 profile); local output uses the browser's IANA time zone, daylight saving included

Limitations

  • Local time is always the visitor's own zone; the widget does not convert to a third, chosen time zone.
  • Leap seconds are not represented, as in POSIX: 2016-12-31T23:59:60Z cannot be entered or shown.
  • Unit detection by digit count assumes dates after 1973; a small seconds value meant as milliseconds (for example 86400000) must be forced to ms by hand.
  • Precision stops at the millisecond: fractions finer than 1 ms are rounded to the nearest millisecond and a note says so.

Where publishers use it

  • Backend and database docs where timestamps appear in logs and API responses
  • Debugging articles about time zones and daylight-saving bugs
  • Data-engineering guides that mix second and millisecond epochs
  • Blog posts about the year-2038 problem

Questions

Is the timestamp in seconds or milliseconds?

Unix tools and most databases use seconds; JavaScript, Java and many APIs use milliseconds. The widget detects which from the length and shows how it read the number.

Does Unix time include time zones?

No. A Unix timestamp is the same everywhere; only its display in local time depends on the zone.

What happens in 2038?

Signed 32-bit timestamps overflow at 2147483647 (2038-01-19 03:14:07 UTC). This widget uses 64-bit values and is not affected.

Are leap seconds counted?

No. Like POSIX time, every day is treated as exactly 86,400 seconds.

Sources

  1. POSIX.1-2024 Base Definitions, section 4.19 Seconds Since the Epoch - The Open Group / IEEE . Definition of Unix time: 86,400 seconds per day, leap seconds not counted
  2. RFC 3339: Date and Time on the Internet: Timestamps - IETF . Profile of ISO 8601 used for the UTC output
  3. IANA Time Zone Database - IANA . Zone and daylight-saving rules the browser applies to local times

Cite or recommend this tool

If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.

A2Z Tools Unix Timestamp Converter
https://a2z.tools/unix-timestamp-converter

Preview