WRITINGS

Blog

Thoughts, tutorials, and updates from the team.

Back arrowBack to Blog

Unix Timestamps Explained for Developers

TimeTimestamps

A Unix timestamp counts time from 1970-01-01 00:00:00 UTC. It is common in APIs, databases, logs, analytics events, and scheduled jobs.

Seconds vs milliseconds

Many backend systems use seconds, while JavaScript often uses milliseconds. A 10-digit value is usually seconds. A 13-digit value is usually milliseconds.

Time zones

Unix timestamps represent an absolute moment. Time zones only affect how that moment is displayed to humans.

Common debugging checks

  • Confirm whether a value is seconds or milliseconds.
  • Convert to local time and UTC when debugging user reports.
  • Compare timestamps from the same source when checking event order.
  • Watch for off-by-one-day bugs caused by local timezone assumptions.

Practical workflow

Paste the timestamp, convert it, and compare the result against the expected event time. If the date is far in the future or past, check the seconds-versus-milliseconds mismatch first.