Skip to content
induwara.lk
induwara.lkDeveloper · Time

Unix Timestamp (Epoch) Converter

Paste a Unix epoch, seconds, milliseconds, microseconds, or nanoseconds, and read it back as a date in UTC, Sri Lanka time, and your own zone, plus relative time, ISO-week facts, and a Year-2038 check. Or go the other way, date to epoch. Everything runs in your browser; nothing is uploaded.

By Induwara AshinsanaUpdated Jun 8, 2026
Unix timestamp converter
POSIX §4.16 verified
Current Unix time—

Auto-detected as seconds from the digit count, override with the unit selector if needed.

Presets
UTC
2023-11-14T22:13:20Z
Tuesday, 14 November 2023, 22:13:20
Sri Lanka (+05:30)
2023-11-15T03:43:20+05:30
Wednesday, 15 November 2023, 03:43:20
Your local time
resolving…
RFC 2822
Tue, 14 Nov 2023 22:13:20 +0000
Relative time
—
Same instant in every unit
s1700000000
ms1700000000000
µs1700000000000000
ns1700000000000000000
Day of week
Tuesday
Day of year
318 / 365
ISO week
46 (2023)
Leap year
No
POSIX.1 · ISO 8601 · RFC 3339 / 2822 · IANA tzdata, all conversion runs in your browser.

How it works

A Unix timestamp is a single integer: the number of seconds since the epoch, 1970-01-01T00:00:00Z, defined by POSIX.1-2017 §4.16. Because it carries no time zone, the same number means the same instant everywhere, the converter's only job is to render that instant clearly and to reverse the process exactly.

  1. Resolve the unit. On Auto-detect, the digit count decides the unit. The canonical lengths (10 = seconds, 13 = milliseconds, 16 = microseconds, 19 = nanoseconds) each sit inside a band:
    • 1–11 digits → seconds
    • 12–14 digits → milliseconds
    • 15–17 digits → microseconds
    • 18–19 digits → nanoseconds
    You can always override this with the unit selector.
  2. Normalise to milliseconds. The value is scaled to milliseconds using exact BigInt arithmetic so a 19-digit nanosecond figure never loses precision to floating point. Microsecond and nanosecond inputs are floor-divided; any sub-millisecond remainder is reported separately rather than rounded into the date.
  3. Build the civil date. The millisecond instant is decomposed into a year/month/day and hour/minute/second using UTC fields only, so the host machine's local offset can never leak into a UTC answer. This matches the POSIX relation days = ⌊seconds / 86400⌋ with the remainder giving the time of day, cross-checked against Howard Hinnant's constant-time days-to-civil algorithm.
  4. Apply target offsets. UTC is shown with the Z suffix; Sri Lanka adds a fixed +05:30 (Asia/Colombo, no DST since 1996); your local zone uses the offset your browser reports for that exact instant, so historical daylight saving is handled correctly.
  5. Format. Each zone is emitted as ISO 8601 / RFC 3339, with an RFC 2822 string for email and HTTP-style dates. The same epoch is echoed in all four units for easy copy-paste.
  6. Reverse direction. Date → Epoch parses your calendar input in the chosen zone, converts it to a UTC instant, and reads back the epoch in every unit. The forward and reverse paths are inverses, so a value round-trips to itself.
  7. Derived facts. Day of week comes from the UTC weekday; day of year by differencing from 1 January; the ISO-8601 week number uses the Monday-start, first-Thursday rule; and leap years follow the Gregorian rule (y%4==0 && y%100!=0) || y%400==0.

Worked examples

Seconds → date

1700000000 (Auto-detect → 10 digits → seconds)

  1. ms = 1 700 000 000 × 1000 = 1 700 000 000 000
  2. Whole days: ⌊1 700 000 000 / 86400⌋ = 19 675
  3. 19 675 × 86 400 = 1 699 920 000; remainder 80 000 s = 22:13:20
  4. UTC: 2023-11-14T22:13:20Z (Tuesday)
  5. Sri Lanka (+05:30): 2023-11-15T03:43:20+05:30
  6. Day of year 318, leap year: no, ISO week 46

Date → epoch (Y2K anchor)

2000-01-01 00:00:00, input zone UTC

  1. Days 1970→2000 = 30×365 + 7 leap days = 10 957
  2. 10 957 × 86 400 = 946 684 800
  3. Epoch: 946 684 800 s / 946 684 800 000 ms
  4. Reverse-check: 946684800 decodes back to 2000-01-01T00:00:00Z ✓

Milliseconds + Year-2038 flag

2147483647000 (Auto-detect → 13 digits → milliseconds)

  1. ms ÷ 1000 = 2 147 483 647 s = INT32_MAX
  2. UTC: 2038-01-19T03:14:07Z
  3. Seconds exceed the signed 32-bit limit, so the tool shows the Year-2038 overflow note

Frequently asked questions

Sources & references

Conversion logic was last cross-checked against these standards on 2026-06-08. Unix time ignores leap seconds by design (POSIX §4.16), so every day is treated as exactly 86,400 seconds.

Related tools

Comments & feedback

Spotted a bug or want an improvement? Tell us, our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] , most fixes ship within 24 hours.