← All Guides
🛠️ Developer Tools

Unix Timestamps: Everything You Need to Know

5 min read · Updated June 2026

A Unix timestamp is the number of seconds since January 1, 1970 00:00:00 UTC (the "Unix epoch"). It's the universal language of time in computing — every database, API, and logging system uses it.

Seconds vs Milliseconds

The #1 Source of Bugs

JavaScript uses milliseconds (13 digits). Most APIs use seconds (10 digits). Always check which one you're dealing with. A 10-digit timestamp in JavaScript gives a date in 1970.

  • Seconds (Unix time) — 10 digits: 1718236800 (June 13, 2024)
  • Milliseconds (JavaScript) — 13 digits: 1718236800000

Common Conversions

// JavaScript: Get current timestamp

Math.floor(Date.now() / 1000) // seconds

Date.now() // milliseconds

// JavaScript: Convert timestamp to date

new Date(timestamp * 1000) // if seconds

new Date(timestamp) // if milliseconds

// Python: Get current timestamp

import time; int(time.time()) // seconds

ISO 8601 Format

The human-readable standard for timestamps:

  • 2026-06-13T12:00:00Z — UTC time (Z = Zulu)
  • 2026-06-13T08:00:00-04:00 — With timezone offset (EDT)
  • 2026-06-13T12:00:00.123Z — With milliseconds

The Bottom Line

  1. Unix timestamps are seconds since 1970-01-01 00:00:00 UTC
  2. JavaScript uses milliseconds — always multiply/divide by 1000
  3. ISO 8601 is the standard format for APIs and logs
  4. Always store timestamps in UTC — convert to local time only for display

⏱ Convert timestamps Instantly

Use our Unix Timestamp Converter to convert between timestamps and readable dates — supports seconds, milliseconds, and ISO 8601.

Disclaimer: This guide is for informational purposes only.