Skip to content
UtiliaTools

Unix Timestamp Explained: Complete Guide to Epoch Time

Master Unix timestamps with practical examples, conversion methods, and a free online epoch converter. Perfect for developers.

Unix Timestamp Explained: Complete Guide to Epoch Time

If you've ever debugged an API response, configured a server log, or worked with databases, you've likely encountered a Unix timestamp. These long numeric strings like 1700000000 look cryptic at first glance, but they're actually one of the simplest and most universal ways to represent a moment in time.

This guide explains what Unix timestamps are, how epoch time works, and how to convert between timestamps and human-readable dates — with practical examples you can use right away.

What Is a Unix Timestamp?

A Unix timestamp is a single number that represents the total seconds elapsed since January 1, 1970, at 00:00:00 UTC. This starting point is called the Unix epoch.

For example, the timestamp 1700000000 corresponds to November 14, 2023, at 22:13:20 UTC. Instead of dealing with years, months, days, hours, minutes, and seconds separately, a timestamp collapses all of that into one integer.

Also known as Unix time, epoch time, or POSIX time, this system is used across virtually every programming language, operating system, and database.

Unix Epoch Explained

The Unix epoch is Thursday, January 1, 1970, 00:00:00 UTC — the moment from which all Unix timestamps begin counting.

Why 1970? When Unix was developed at Bell Labs in the early 1970s, the creators needed a reference point. January 1, 1970 was chosen as a practical starting date — it was recent enough to be relevant, and it conveniently fell on the start of a year.

Every second since that moment adds one to the timestamp. As of this writing, we're past 1.76 billion seconds since the epoch.

Seconds vs Milliseconds

One of the most common sources of confusion is the difference between seconds and milliseconds:

Precision Digits Example Used By
Seconds 10 1700000000 Python, PHP, most APIs
Milliseconds 13 1700000000000 JavaScript, Java, many web APIs

Rule of thumb: If your timestamp has 10 digits, it's in seconds. If it has 13 digits, it's in milliseconds. To convert between them, multiply or divide by 1,000.

How to Convert Unix Timestamp to Date

Converting a timestamp to a readable date is straightforward with the right tools.

Using our converter: Enter the timestamp into our Unix Timestamp Converter and get the date instantly.

In code:

// JavaScript (expects milliseconds)
const date = new Date(1700000000 * 1000);
console.log(date.toISOString());
// Output: "2023-11-14T22:13:20.000Z"
# Python
import datetime
dt = datetime.datetime.fromtimestamp(1700000000, tz=datetime.timezone.utc)
print(dt.isoformat())
# Output: "2023-11-14T22:13:20+00:00"
// PHP
echo date('Y-m-d H:i:s', 1700000000);
// Output: "2023-11-14 22:13:20"

How to Convert Date to Unix Timestamp

The reverse process — converting a date to a timestamp — is equally common.

// JavaScript
const timestamp = Math.floor(
  new Date("2024-01-15T12:00:00Z").getTime() / 1000
);
console.log(timestamp); // 1705320000
# Python
import datetime
dt = datetime.datetime(2024, 1, 15, 12, 0, 0, tzinfo=datetime.timezone.utc)
print(int(dt.timestamp()))  # 1705320000
// PHP
echo strtotime("2024-01-15T12:00:00+00:00");
// Output: 1705320000

Unix Timestamp Examples

Here are some notable timestamps for reference:

Timestamp Date (UTC) Significance
0 Jan 1, 1970 00:00:00 The Unix epoch
1000000000 Sep 9, 2001 01:46:40 The billionth second
1234567890 Feb 13, 2009 23:31:30 A popular test value
1700000000 Nov 14, 2023 22:13:20 A round recent number
2000000000 May 18, 2033 03:33:20 A future milestone
2147483647 Jan 19, 2038 03:14:07 Max 32-bit signed value

Common Timestamp Formats

Unix timestamps are just one way to represent dates. Here's how the same moment looks in different formats:

Format Example
Unix timestamp 1700000000
ISO 8601 2023-11-14T22:13:20Z
RFC 2822 Tue, 14 Nov 2023 22:13:20 +0000
RFC 3339 2023-11-14T22:13:20+00:00
Human-readable November 14, 2023 10:13:20 PM

ISO 8601 is the most widely used format in APIs and modern systems. The Z suffix means "Zulu time" (UTC).

Unix Timestamp in Programming

Every major language provides built-in support for working with timestamps.

JavaScript

// Current timestamp (milliseconds — divide by 1000 for seconds)
const now = Math.floor(Date.now() / 1000);

// Timestamp to date
const date = new Date(1700000000 * 1000);

// Date to timestamp
const ts = Math.floor(new Date("2024-06-15").getTime() / 1000);

Python

import datetime

# Current timestamp
now = int(datetime.datetime.now().timestamp())

# Timestamp to date
dt = datetime.datetime.fromtimestamp(1700000000, tz=datetime.timezone.utc)

# Date to timestamp
ts = int(datetime.datetime(2024, 6, 15, tzinfo=datetime.timezone.utc).timestamp())

PHP

// Current timestamp
$now = time();

// Timestamp to date
echo date('Y-m-d H:i:s', 1700000000);

// Date to timestamp
$ts = strtotime("2024-06-15");

Common Mistakes

1. Confusing seconds and milliseconds The most frequent error. JavaScript's Date.getTime() returns milliseconds, while Python's time.time() returns seconds. Always check which unit your tool expects — a 13-digit number means milliseconds.

2. Ignoring time zones Unix timestamps are always UTC. If you display a timestamp without specifying a time zone, it defaults to UTC. Use your language's localization functions to convert to local time.

3. The Year 2038 problem On January 19, 2038, 32-bit signed timestamps will overflow (2,147,483,647 is the maximum). Most modern systems use 64-bit integers, so this isn't a practical concern — but it's worth knowing if you work with legacy systems.

4. Forgetting about leap seconds Unix timestamps ignore leap seconds. Each day is treated as exactly 86,400 seconds. For most applications this doesn't matter, but high-precision systems need to account for it.

Try Our Free Unix Timestamp Converter

Need to quickly convert a timestamp to a date — or the other way around? Our Unix Timestamp Converter handles both directions instantly. Enter a value, get your result, and copy it with one click.

It's perfect for debugging API responses, verifying database entries, or converting log file timestamps. You can also explore our What Is a Timestamp? guide for deeper background.

Frequently Asked Questions

What is a Unix timestamp? A Unix timestamp is the number of seconds that have elapsed since January 1, 1970 (the Unix epoch). It's a universal, time-zone-free way to represent any moment in time as a single integer.

How do I get the current Unix timestamp? In JavaScript: Math.floor(Date.now() / 1000). In Python: int(time.time()). In PHP: time(). All return the current seconds since the epoch.

Why does JavaScript use milliseconds? JavaScript's Date object was designed for millisecond precision, which is useful for web applications. Multiply seconds by 1,000 or divide milliseconds by 1,000 to convert between the two.

Are Unix timestamps affected by time zones? No. Timestamps are always UTC. Time zones only matter when you convert a timestamp into a human-readable date for display.

What happens after the Year 2038? 32-bit signed timestamps overflow on January 19, 2038. Modern 64-bit systems can represent dates for billions of years, so this is not a practical issue for current software.

How do I convert milliseconds to seconds? Divide by 1,000. For example, 1700000000000 milliseconds equals 1700000000 seconds.

Conclusion

Unix timestamps are a foundational concept in computing. They provide a simple, universal way to represent time that works across every language, platform, and database. Whether you're converting timestamps in code, debugging log files, or just curious about what 1700000000 means, understanding epoch time is an essential skill for any developer.

Bookmark our Unix Timestamp Converter for quick conversions, and check out the Date Difference Calculator and Age Calculator for more date-related tools.

Last updated on 2026-10-02