Skip to main content
Technology

Unix Timestamp

unix-timestamp

Overview

A Unix timestamp (also called POSIX time or Epoch time) represents a point in time as the number of seconds elapsed since the Unix Epoch: January 1, 1970, at 00:00:00 UTC. This simple integer representation makes it easy to store, compare, and transmit time values across different systems and programming languages.

The Year 2038 Problem

Systems that store Unix timestamps as signed 32-bit integers will overflow on January 19, 2038, at 03:14:07 UTC. After this moment, the timestamp wraps to a large negative number, potentially causing catastrophic failures. Storing timestamps as 64-bit integers extends the range to approximately 292 billion years in either direction and avoids this limit in practice, but 32-bit time representations can remain in embedded devices, legacy file formats, and older libraries.

Usage in APIs

Many web APIs return timestamps in Unix format, either as seconds or milliseconds since the epoch. JavaScript's Date.now() returns milliseconds, while Python's time.time() returns seconds as a float. When exchanging timestamps between systems, always clarify whether the value is in seconds or milliseconds to avoid off-by-a-factor-of-1000 bugs.

Was this article helpful?

Related Terms

Related Articles