TR

Home / Guides / What Is a Unix Timestamp (Epoch Time)? Converting to and from Dates, the 2038 Problem

What Is a Unix Timestamp (Epoch Time)? Converting to and from Dates, the 2038 Problem

Updated: November 6, 2026 · AracMerkezi

▶ Open Unix Timestamp Converter

A Unix timestamp (epoch time) is the number of seconds that have passed since January 1, 1970 at 00:00:00 UTC. Because it is a single number, it is very easy to store dates, compare them and move them between different systems; it is widely used in databases, APIs, log files and JWT tokens. This guide explains, with tested examples, how to convert a timestamp to a date by hand and in code, how to find the difference between two timestamps, and the 2038 limit.

Examples

TimestampEquivalent (UTC)
0January 1, 1970 00:00:00
1,000,000,000September 9, 2001 01:46:40
1,767,225,600January 1, 2026 00:00:00
1,800,000,000January 15, 2027 08:00:00

Seconds or milliseconds?

Classic Unix time is in seconds and is a 10-digit number (current values are about 1.7 billion). JavaScript’s Date.now() value, on the other hand, is in milliseconds and has 13 digits. If a value has 13 digits, it is usually milliseconds; you divide by 1000 to get seconds. Example: 1,800,000,000,000 milliseconds, divided by 1000, is 1,800,000,000 seconds.

Time zone

A timestamp is independent of time zone; it always counts relative to UTC. When converting to a date, you choose which time zone to display it in. Turkey is at UTC+3, so the same timestamp appears 3 hours ahead of UTC in local time: the value 1,800,000,000 is 08:00 in UTC and 11:00 in Turkey time. Someone reading the same moment in New York sees the same number too; only the clock text on the screen differs, so passing the number between systems prevents misunderstandings. For time zone differences, see the time zone guide.

Converting by hand: what date is 1,800,000,000?

A day is 86,400 seconds (24 × 60 × 60). Steps:

  1. Whole days: 1,800,000,000 / 86,400 = 20,833.33… so 20,833 days.
  2. Remaining seconds: 1,800,000,000 − 20,833 × 86,400 = 28,800 seconds = 8 hours.
  3. Adding 20,833 days to January 1, 1970 gives January 15, 2027; time 08:00:00 UTC.

Checking in the reverse direction: 20,833 × 86,400 = 1,799,971,200, and adding 28,800 gives exactly 1,800,000,000, so the division and remainder came out right. We confirmed the result in a terminal with date -u -d @1800000000: “Fri Jan 15 08:00:00 UTC 2027”.

Converting with code

We ran and tested the following; all give the same moment:

The Unix Timestamp Converter on our site converts in both directions.

The difference between two timestamps

The difference is found by subtraction. Let March 15, 2026 09:00 UTC = 1,773,565,200 and March 18, 2026 17:30 UTC = 1,773,855,000:

For calendar-day and business-day differences, see the days between two dates guide. To add months and years, adding seconds is not enough, because months are not the same length.

The 2038 problem

In older systems the timestamp is stored in a 32-bit signed number. The largest value this number can take, 2,147,483,647, corresponds to January 19, 2038 03:14:07 UTC. After that date, overflow can occur in 32-bit systems; if the number wraps to a negative value, a date such as December 13, 1901 20:45:52 UTC appears. In systems that use unsigned 32-bit, the limit is 4,294,967,295, which is February 7, 2106 06:28:15 UTC. Modern systems use 64 bits, so they are not affected by this problem.

Example use in JWTs and logs

The iat (issued at) and exp (expiry) fields in JWT tokens are Unix time in seconds. If iat = 1,800,000,000 and the token is valid for 1 hour, exp = 1,800,000,000 + 3,600 = 1,800,003,600; that is January 15, 2027 09:00:00 UTC. A timestamp past the expiry moment means “expired.” In log files, sorting lines by timestamp causes fewer errors than parsing date strings.

Practical tips

Common mistakes

Glossary

You can use the Unix Timestamp Converter tool for conversion. To calculate the day difference between two dates, see the Date Difference Calculator; for the exp field in a JWT, see the JWT guide.

Frequently asked questions

What does a Unix timestamp count?

The seconds that have passed since January 1, 1970 00:00:00 UTC.

What is a 13-digit timestamp?

It is usually in milliseconds; divide by 1000 to convert to seconds.

What is the 2038 problem?

The overflow of a 32-bit signed timestamp at 03:14:07 UTC on January 19, 2038; modern systems that use 64 bits are not affected.

Tools mentioned in this guide

More guides

This article is for general information only and is not legal, financial or medical advice. We are not an official institution.