How to Convert Unix Timestamps

· 5 min read

Unix timestamps are how computers store and communicate time: a single number representing seconds since January 1, 1970. They appear in API responses, database records, log files, and JWT tokens. When you need to know what date 1711824000 actually is, you need a converter. A browser-based converter handles the math instantly and lets you go either direction (timestamp to date, date to timestamp).

What a Unix timestamp looks like

Timestamp Type Human-readable
0 Seconds Jan 1, 1970 00:00:00 UTC
1000000000 Seconds Sep 9, 2001 01:46:40 UTC
1234567890 Seconds Feb 13, 2009 23:31:30 UTC
1711824000 Seconds Mar 31, 2024 00:00:00 UTC
1711824000000 Milliseconds Mar 31, 2024 00:00:00 UTC
2147483647 Seconds Jan 19, 2038 03:14:07 UTC (32-bit signed max)

The difference between seconds and milliseconds is three extra zeros. A 10-digit number is in seconds; 13 digits is milliseconds. As of 2024, all seconds-based Unix timestamps are 10 digits and will remain so until November 2286.

How to convert timestamps

  1. Enter a timestamp or date: paste a Unix timestamp to convert to a readable date, or enter a date to get the timestamp.
  2. Check the format: the converter auto-detects seconds vs milliseconds based on the number length.
  3. Read the result: see the date in your local timezone, UTC, and ISO 8601 format.

A brief history of Unix time

Unix time was first defined in the Unix Programmer's Manual published at Bell Labs in November 1971. The original epoch was January 1, 1971, but it was changed to January 1, 1970 shortly afterward and standardized in POSIX.1 (1988).

The choice of 1970 was arbitrary but practical: Unix was developed in 1969-1971, and starting the count near the OS's birth seemed reasonable. A 32-bit signed integer counting seconds from 1970 gave a range from December 1901 to January 2038, which the designers thought would be enough.

It is not. The "Year 2038 problem" (also called Y2K38) is the moment when 32-bit signed Unix timestamps overflow: 2147483647 seconds after the epoch, the next tick rolls over to a negative number that systems interpret as December 1901. Most modern systems migrated to 64-bit integer timestamps in the 2000s and 2010s, but some embedded devices, older databases, and legacy file formats still use 32-bit time and will need patches before 2038.

Unix time is now the de facto standard for representing time in computer systems. JSON APIs, database row timestamps, JWT expirations, blockchain block-times, IoT sensor readings: nearly all use the Unix epoch directly or indirectly.

Seconds, milliseconds, microseconds, nanoseconds

Different systems use different precisions:

A 19-digit timestamp can confuse converters expecting milliseconds; double-check the source documentation when you see anomalous numbers.

Where you encounter timestamps

Timestamps in code

Quick conversion in common languages:

JavaScript:

new Date(1711824000 * 1000)            // From seconds (multiply by 1000)
new Date(1711824000000)                // From milliseconds
Math.floor(Date.now() / 1000)          // Current time in seconds
Date.now()                             // Current time in milliseconds

Python:

from datetime import datetime, timezone
datetime.fromtimestamp(1711824000, tz=timezone.utc)
datetime.now(timezone.utc).timestamp()  # Current time in seconds (float)

Bash:

date -u -d @1711824000                 # GNU date (Linux)
date -u -r 1711824000                  # BSD date (macOS)
date +%s                               # Current time in seconds

SQL (PostgreSQL):

SELECT TO_TIMESTAMP(1711824000);       -- Convert epoch to timestamp
SELECT EXTRACT(EPOCH FROM NOW());      -- Current epoch

Go:

time.Unix(1711824000, 0)               // From seconds
time.Now().Unix()                      // Current time in seconds

Timezone handling

This is where most timestamp bugs hide:

When sending timestamps in APIs, always use UTC seconds. When displaying to users, convert to their local timezone. The converter handles both directions.

Common pitfalls

Tips

Privacy

The Unix timestamp converter runs entirely in your browser. The timestamps and dates you enter never leave your device. This matters because timestamps can be sensitive: they may be from log files revealing internal infrastructure timing, JWT tokens with embedded user/session info, internal API debugging that should not be shared with third parties. Cloud timestamp converters may log inputs for "improvement" purposes; a browser-only converter has zero exposure.

Browser-based conversion also works offline once the page loads, and is fast enough that you can drop a timestamp into the field and see the date in the same moment.

Frequently Asked Questions

What is Unix epoch time?

Unix epoch time (also called POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 at 00:00:00 UTC. It is the standard way computers represent time internally.

What is the difference between seconds and milliseconds timestamps?

Unix timestamps in seconds are 10 digits (e.g., 1711824000). Millisecond timestamps are 13 digits (e.g., 1711824000000). JavaScript uses milliseconds, most APIs and databases use seconds. The converter auto-detects based on length.

Why is my converted time off by several hours?

Timestamps are always in UTC. The converter shows both UTC and your local time. If the result does not match your expectation, you are probably comparing UTC output to local time, or vice versa.

What happens in 2038?

Systems that store Unix timestamps as 32-bit signed integers will overflow on January 19, 2038. Most modern systems use 64-bit integers, which extends the range far beyond any practical concern.