ConvertCaseTool
Technical5 min read

Unix Timestamp Explained: What Is Epoch Time and How to Convert It

If you work with APIs, databases, or log files, you've likely encountered numbers like 1711929600 that represent dates and times. These are Unix timestamps, and they are the universal language of time in computing. This guide explains what they are, why they exist, and how to convert them.

What Is a Unix Timestamp?

A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC. This moment is known as the Unix epoch. Every moment in time can be represented as a single integer — no time zones, no formatting ambiguity, just a number.

Examples:

0 → January 1, 1970 00:00:00 UTC

1000000000 → September 9, 2001 01:46:40 UTC

1711929600 → April 1, 2024 00:00:00 UTC

2147483647 → January 19, 2038 03:14:07 UTC (Y2K38)

Convert any timestamp instantly with our Timestamp Converter.

Why Use Unix Timestamps?

  • No time zone confusion: A timestamp is always UTC. No ambiguity about which time zone a date refers to.
  • Easy math: Want to know the time 24 hours from now? Just add 86,400 (the number of seconds in a day).
  • Universal format: Every programming language and database can work with integers. Date string formats vary by locale and library.
  • Compact storage: A 32-bit integer uses far less space than a formatted date string.
  • Easy comparison: Sorting and comparing timestamps is a simple numeric operation.

How to Get the Current Timestamp

LanguageCode
JavaScriptMath.floor(Date.now() / 1000)
Pythonimport time; int(time.time())
PHPtime()
JavaSystem.currentTimeMillis() / 1000
RubyTime.now.to_i
Bashdate +%s
SQLUNIX_TIMESTAMP()

Seconds vs Milliseconds

A common source of confusion: some systems use seconds since epoch (10 digits, like 1711929600) while others use milliseconds (13 digits, like 1711929600000). JavaScript's Date.now() returns milliseconds. Most Unix commands and databases use seconds.

If your timestamp has 13 digits, divide by 1000 to get seconds. If it has 10 digits, it's already in seconds.

The Year 2038 Problem (Y2K38)

Unix timestamps stored as 32-bit signed integers can only represent dates up to January 19, 2038, at 03:14:07 UTC. After that, the integer overflows and wraps to a negative number, which the system interprets as December 13, 1901. This is known as the Year 2038 Problem or Y2K38.

Most modern systems have already migrated to 64-bit timestamps, which can represent dates billions of years into the future. But legacy systems, embedded devices, and old databases may still be affected.

Where You'll Find Timestamps

  • JWT tokens: The iat (issued at) and exp (expiration) claims in JWT tokens are Unix timestamps
  • API responses: Many REST APIs return dates as timestamps for consistency
  • Database columns: created_at and updated_at fields often store timestamps
  • Log files: System and application logs frequently use epoch time
  • JSON data: Timestamps are common in JSON payloads from APIs

Convert Unix Timestamps

Convert between Unix timestamps and human-readable dates instantly.

Open Timestamp Converter →