Developer Utilities 4 min read Oct 07, 2026 FormatKit Engineering 8 views

Unix Timestamps Explained: Milliseconds, UTC, and Timezone Pitfalls

Understand the Unix Epoch (January 1, 1970 UTC). Avoid common bugs with 10-digit seconds vs 13-digit milliseconds and timezone conversion mistakes.
Quick Answer • Key Takeaway
A Unix timestamp is the count of elapsed seconds (or milliseconds) since midnight UTC on January 1, 1970. Unix timestamps are strictly timezone-agnostic. When debugging, remember that Unix seconds have 10 digits (e.g. 1735689600) while JavaScript milliseconds have 13 digits (e.g. 1735689600000).
Guide Sections

What is the Unix Epoch?

The Unix timestamp (also known as POSIX time or Epoch time) represents the number of seconds that have elapsed since 00:00:00 UTC on Thursday, 1 January 1970 (excluding leap seconds). It has become the universal foundation for timestamp storage in databases, logging frameworks, and network protocols.

The 10-Digit vs 13-Digit Trap

Precision Digit Length Standard Ecosystem Example
Seconds 10 digits PHP (time()), Python (time.time()), MySQL (UNIX_TIMESTAMP()) 1716984000
Milliseconds 13 digits JavaScript (Date.now()), Java (System.currentTimeMillis()) 1716984000000
1970 Date Bug

If you pass a 10-digit Unix second timestamp into JavaScript's new Date(timestamp), JavaScript interprets it as milliseconds, resulting in dates near January 1970. Always multiply seconds by 1000: new Date(timestampInSeconds * 1000).

Convert Unix Timestamps to Human Dates

Live conversion between seconds, milliseconds, UTC strings, and ISO-8601 timestamps.

Timestamp Converter →

Frequently Asked Questions

Does a Unix timestamp change based on timezone?
No. A Unix timestamp is identical at any given instant everywhere on Earth because it is anchored strictly to UTC. Timezones only apply when formatting the timestamp into human-readable local strings.
What is ISO 8601 format?
ISO 8601 is an international standard for expressing dates as strings: YYYY-MM-DDTHH:mm:ss.sssZ (e.g., 2024-05-29T12:00:00.000Z). The trailing Z denotes zero UTC offset.
On This Page
100% In-Browser Privacy

FormatKit tools and interactive code examples run completely in your client browser sandbox. We never store, log, or transmit your code, tokens, or confidential API payloads.