Epoch Converter

Convert between Unix timestamps and human-readable dates

The current Unix epoch time is

0

Convert Timestamp to Human Date
Supports Unix timestamps in different units
Convert Human Date to Timestamp
Enter a date in various formats

Formats: RFC 2822, ISO 8601, MM/DD/YYYY, DD-MM-YYYY, etc.

What is Unix Epoch Time?

The Unix epoch is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds.

1 hour3,600 seconds
1 day86,400 seconds
1 week604,800 seconds
1 year31,556,926 seconds
Common Timestamp Confusions & Best Practices
Learn about the most common pitfalls developers face with timestamps
1

Seconds vs Milliseconds - The #1 Issue

Different systems use different units, leading to dates in year 1970 or 50,000+

Seconds (10 digits)

1766408172

Used by: Unix/Linux, Python, PHP, Ruby

Milliseconds (13 digits)

1766408172000

Used by: JavaScript, Java, .NET

💡 Pro Tip:

Count the digits! 10 = seconds, 13 = milliseconds, 16 = microseconds, 19 = nanoseconds

2

UTC vs Local Time

Timestamps are always UTC, but displaying requires timezone conversion

// ❌ Wrong - assumes server timezone

const date = new Date("2025-12-22 14:30:00")

// ✅ Better - explicit timezone

const date = new Date("2025-12-22T14:30:00Z") // UTC

const date = new Date("2025-12-22T14:30:00-05:00") // EST

3

Database Storage Best Practices

Choosing the right data type is crucial

INT (32-bit)

❌ Limited to 2038, avoid for new systems

BIGINT (64-bit)

✅ Recommended - supports milliseconds & beyond 2038

DATETIME / TIMESTAMP

⚠️ Timezone handling varies by database

✅ Recommendation:

Store as BIGINT (milliseconds since epoch) for maximum flexibility and compatibility

4

Date String Formats

Different systems use different date string formats

ISO 8601: 2025-12-22T14:30:00Z
RFC 2822: Mon, 22 Dec 2025 14:30:00 GMT
US Format: 12/22/2025 2:30 PM
European: 22/12/2025 14:30

💡 Always use ISO 8601 for data exchange and storage

5

The Year 2038 Problem

32-bit signed integers overflow on January 19, 2038 at 03:14:07 UTC

Max 32-bit timestamp:2,147,483,647
Date:January 19, 2038

Solution: Use 64-bit integers (BIGINT in SQL, long in Java)

6

Negative Timestamps (Before 1970)

Dates before January 1, 1970 have negative timestamps

December 31, 1969

-86400

January 1, 1960

-315619200

⚠️ Not all systems handle negative timestamps correctly

7

Leap Seconds

Unix timestamps ignore leap seconds for simplicity

Real-world time occasionally adds a leap second to keep atomic clocks in sync with Earth's rotation. Unix time ignores these adjustments, which can cause sub-second timing issues in precise applications.

Examples: GPS systems, financial trading, scientific measurements