How to Convert Unix Timestamps to Human-Readable Dates

Developer

Learn what a Unix timestamp is, how to convert it to a readable date and time, and how to generate the current timestamp for use in code.

Panduan Langkah demi Langkah

1

Understand Unix timestamps

A Unix timestamp is the number of seconds elapsed since January 1, 1970, 00:00:00 UTC (the Unix epoch). Example: 1700000000 = November 14, 2023, 22:13:20 UTC.

2

Convert timestamp to date

Open our Unix Timestamp Converter, paste your timestamp in the input field, and instantly see the human-readable date in UTC and your local timezone.

3

Convert date to timestamp

Enter a date and time in the converter to get the corresponding Unix timestamp. Useful for setting expiration times in JWTs, cookies, and database records.

4

Get the current timestamp

In JavaScript: Math.floor(Date.now() / 1000). In Python: import time; int(time.time()). In bash: date +%s. Our tool also shows the current timestamp live.

5

Handle millisecond timestamps

Some systems use milliseconds (13 digits) instead of seconds (10 digits). Divide by 1000 to convert to seconds. JavaScript's Date.now() returns milliseconds by default.

Coba Alat Gratis Kami

Unix Timestamp Converter

Pertanyaan yang Sering Diajukan

Q: What is the maximum Unix timestamp?

A: The 32-bit signed integer maximum is 2,147,483,647, which corresponds to January 19, 2038 — the "Year 2038 problem". Modern systems use 64-bit integers, extending this far into the future.

Q: Is Unix time the same everywhere?

A: Yes — Unix time counts seconds from the UTC epoch, so it's the same globally. Conversion to local time requires knowing the timezone offset.

Q: Why do timestamps sometimes have 13 digits?

A: Millisecond-precision timestamps have 13 digits (seconds × 1000). Divide by 1000 and floor to get the standard 10-digit Unix timestamp in seconds.