Skip to content
ToolkitHub

Epoch Timestamp Converter

Convert epoch timestamps

Guide

How Unix epoch timestamps work

By Logappradeep · ServiceNow developer

A Unix timestamp, also called epoch time or POSIX time, counts the seconds that have elapsed since 00:00:00 UTC on January 1, 1970, known as the Unix epoch. It is a single integer with no time zone, no calendar and no formatting, which makes it ideal for storing, sorting and comparing moments in databases, logs, APIs and tokens.

Worked example

The timestamp 1700000000 is 1.7 billion seconds after the epoch. Converting it gives 2023-11-14T22:13:20Z in ISO 8601 form, or Tue, 14 Nov 2023 22:13:20 GMT. The same instant displays differently depending on where you are: in New York, which was on UTC-5 that day, it was 5:13:20 PM local time. The number itself never changes; only the presentation does.

How the converter works

The top of the page shows the current epoch in seconds, updating every second. Enter any timestamp and click Convert to see it as a GMT/UTC string, in your browser's local time zone, and in ISO 8601. Values longer than 10 digits are treated as milliseconds, so both 1700000000 and 1700000000000 resolve to the same moment. The refresh button loads the current time into the input.

Where you see epoch time

  • The exp, iat and nbf claims in JWTs are epoch seconds.
  • Log files and metrics systems often record events as epoch values.
  • Databases store timestamps internally as offsets from an epoch.
  • APIs from payment providers, chat platforms and cloud services return created and updated times as integers.

Pitfalls developers hit

Seconds versus milliseconds. Unix tools and most back-end languages use seconds, but JavaScript's Date.now() and Java's System.currentTimeMillis() return milliseconds. Treating milliseconds as seconds lands you tens of thousands of years in the future; the reverse lands you in January 1970. A quick check: current timestamps in seconds have 10 digits, in milliseconds 13.

Micro and nanoseconds. Some systems emit 16-digit microseconds or 19-digit nanoseconds. Divide by 1,000 or 1,000,000 to get milliseconds before converting here.

Time zones belong to display only. Epoch time is always UTC. Bugs appear when local times are converted to timestamps without stating a zone, so a server in one region and a browser in another disagree. Store UTC and convert at the edges.

The year 2038 problem. Systems that store epoch seconds in a signed 32-bit integer overflow after 2147483647, which is 2038-01-19T03:14:07Z. Use 64-bit integers for timestamps.

Leap seconds. Unix time ignores them and treats every day as exactly 86,400 seconds, which keeps arithmetic simple but means it is not a perfect count of elapsed SI seconds.

Conversion uses your browser's built-in Date functions, so nothing is sent to a server.

Frequently asked questions

What is the Unix epoch?

It is 00:00:00 UTC on January 1, 1970. Unix timestamps count the seconds since that moment.

How do I tell seconds from milliseconds?

Present-day timestamps have 10 digits in seconds and 13 digits in milliseconds. This converter treats anything longer than 10 digits as milliseconds.

Do Unix timestamps have a time zone?

No. They always represent an instant in UTC. Time zones only matter when you display the timestamp as a date and time.

What happens in 2038?

Systems that store timestamps as signed 32-bit integers overflow after 03:14:07 UTC on January 19, 2038. Systems using 64-bit integers are unaffected.