The single integer that represents time across nearly every system
A Unix timestamp (also called Unix time or epoch time) is the number of seconds that have elapsed since midnight UTC on January 1, 1970 — the "Unix epoch." Instead of storing a date as a year, month, day, hour, minute, and second, it's stored as a single integer that counts upward continuously. As of mid-2026, that number is in the neighborhood of 1.78 billion.
This design exists because comparing two timestamps, calculating the duration between them, or sorting a list of events chronologically is just simple arithmetic on integers — no calendar logic, no time zone handling, no leap year edge cases. Nearly every programming language, database, and API represents time internally this way, even if it displays a human-readable date on the surface.
The single most common Unix timestamp mistake is a units mismatch. Unix time is traditionally defined in seconds, but JavaScript's Date.now() and many JavaScript-based APIs return milliseconds instead — a value 1,000 times larger. Feeding a millisecond timestamp into a function expecting seconds produces a date thousands of years in the future; feeding a second-based timestamp into something expecting milliseconds produces a date stuck near January 1, 1970. If a converted date looks wildly wrong, checking whether the input is in seconds or milliseconds is almost always the fix.
A quick sanity check: current timestamps in seconds are 10 digits long (around 1,780,000,000); the same moment in milliseconds is 13 digits long (around 1,780,000,000,000).
A Unix timestamp itself has no time zone — it's an absolute count of seconds since the epoch, identical everywhere in the world at any given instant. Time zone only enters the picture when you convert that number into a human-readable date, since "what time is it" depends on where you are. This is precisely why storing timestamps (rather than pre-formatted local date strings) in databases and APIs is the standard practice: the same stored number can be correctly displayed as 3:00 PM in New York and 8:00 PM in London without any ambiguity about which moment is meant.
created_at, updated_at, and expires_at fields are frequently returned as raw Unix timestamps rather than formatted datesiat (issued-at) and exp (expiration) fields in a JSON Web Token are Unix timestamps in secondsEvery mainstream language provides a built-in way to convert between Unix time and a structured date:
new Date(timestamp * 1000) for seconds-based input, since the Date constructor expects millisecondsdatetime.fromtimestamp(timestamp) from the datetime moduleTO_TIMESTAMP() or FROM_UNIXTIME() depending on the dialectWhy does my timestamp show a date in the year 55,000 or similar? This is almost always a seconds-vs-milliseconds mismatch — the value was likely in milliseconds but treated as seconds, multiplying the resulting date far into the future.
Do Unix timestamps account for leap seconds? No — Unix time simplifies by ignoring leap seconds entirely, treating every day as exactly 86,400 seconds, which occasionally causes it to drift very slightly from true astronomical time.
Is a negative Unix timestamp valid? Yes — negative values represent moments before the epoch (before January 1, 1970), and are supported by most conversion tools and libraries for historical date calculations.
Use the DataBench Unix Timestamp Converter to convert between Unix time and human-readable dates in either direction, with support for both seconds and milliseconds — right in your browser.