Unix Timestamp Guide

Understand Unix epoch timestamps — what they are, how to convert them, and common pitfalls.

A Unix timestamp counts the number of seconds since January 1, 1970 00:00:00 UTC (the "Unix epoch"). It is the standard way programming languages and databases store time internally.

Seconds vs milliseconds

Most systems use seconds (10 digits, e.g. 1700000000). JavaScript and some APIs use milliseconds (13 digits, e.g. 1700000000000). Always check which format your system expects.

Common use cases

  • Debugging API responses and log files
  • Database query filters by date range
  • Cache expiration and TTL values
  • JWT token expiration (exp claim)
Convert timestamps