Skip to content
ihategas.xyz

Epoch Converter

Unix timestamps to UTC, local and relative time.

Runs offline

seconds or milliseconds — detected automatically
ISO 8601 — editable
Local time
11/14/2023, 10:13:20 PM
Full ISO
2023-11-14T22:13:20.000Z
Relative
in 0 seconds
Read as seconds

Solidity's block.timestamp is always seconds; JavaScript's Date.now() is milliseconds. Mixing them up is a factor of a thousand.

About epoch converter

Solidity's block.timestamp is in seconds. JavaScript's Date.now() is in milliseconds. Almost every off-by-a-thousand bug in a vesting schedule or a deadline traces back to that mismatch. Paste either and this works out which you meant from the number of digits, then shows the result in UTC, local time and relative terms.

Common questions

How do I convert a Unix timestamp to a date?

Paste the seconds or milliseconds and this shows UTC, your local time, and how far away that moment is. Block explorers and many contracts store times as Unix epochs, so a raw integer is usually a date rather than an amount.

Why do blockchain tools use Unix time?

An integer seconds-since-1970 is unambiguous across time zones and fits cleanly in calldata. Human calendars are display; the chain stores the number. This page translates between the two without a spreadsheet.

What about block numbers versus timestamps?

A block number is not a time. Mapping a block to a clock needs that chain history; this converter only handles epoch integers you already have. For a block number, use an explorer on that network.

More developer tools