Every database row, log line, and API response you touch today probably carries a Unix timestamp: a single integer standing in for one precise moment. It is one of the few conventions that survived the mainframe era, the first web boom, and the move to containers without much change. That longevity is the good news. The bad news is that the integer is only half the story — the unit, the timezone, and the way your language parses it all decide whether that number means Friday afternoon or Thursday midnight.
What the epoch actually counts
A Unix timestamp counts the time elapsed since 00:00:00 UTC on 1 January 1970, the "epoch" chosen by early Unix engineers as a convenient round number. Positive values move forward from that moment; negative values reach backward, which is why a 1965 date can legitimately appear as roughly minus 150 million seconds. The count is continuous: no timezone, no daylight saving shift, no calendar. That is the whole point. A timestamp identifies an instant, and the same instant is the same number whether you read it in Tokyo, Lisbon, or a server rack in Virginia.
Because it is just a number, it sorts correctly, indexes efficiently in databases, and compares with a single subtraction. Durations become trivial: subtract one timestamp from another and you have the seconds, or milliseconds, between two events. That simplicity is why timestamps outlive the systems that created them, and why so many APIs still hand you a bare integer instead of a formatted date.
Seconds or milliseconds? The unit trap
The classic bug is not a wrong date but a wrong scale. Unix time was defined in seconds, and most server-side APIs still return seconds. JavaScript, however, stores dates internally as milliseconds, so Date.now() returns a value in the billions of thousands while a Python API hands you one in the billions. Feed seconds into a JavaScript date constructor and you land in January 1970; feed milliseconds into a seconds-based function and you land tens of thousands of years in the future.
Other ecosystems add their own conventions. Java's Instant uses seconds plus nanoseconds. Some analytics platforms report microseconds, and a few low-level systems use nanoseconds. The practical rule: check the digit count before converting. Ten digits is almost always seconds, thirteen is milliseconds, sixteen is microseconds. A quick sanity check — does the converted year fall within the last few decades? — catches the mistake faster than any stack trace.
created_at_ms instead of created_at. It looks clumsy in a schema review and saves an entire afternoon six months later.
Timezones: stored as UTC, displayed as local
Timestamps themselves have no timezone. 2026-10-30T09:00:00-04:00 and 2026-10-30T13:00:00Z are the same instant written two ways. Confusion starts when a timestamp is converted to text without an offset, or when a date-only string is parsed as local time in one place and UTC in another.
Two rules prevent most incidents. First, store and transmit UTC — or the raw integer — and convert only at the edge where a human reads it. Second, always include an explicit offset when writing ISO 8601. A string like 2026-10-30 09:00 is ambiguous; 2026-10-30T09:00:00Z is not.
Daylight saving makes the ambiguity worse. During a fall-back hour, a local wall-clock time can occur twice, and during spring-forward it may not occur at all. If you store local times without offsets, two events an hour apart can look identical. Converting through UTC first keeps the ordering intact. Our time zone converter is handy when you need to check how a given instant looks in another region before scheduling something.
The gotchas that still bite in production
2038. Signed 32-bit integers max out at 2,147,483,647 seconds, which is 03:14:07 UTC on 19 January 2038. Old systems, embedded devices, and some file formats still store time that way. Most modern stacks use 64-bit values and will not notice, but an audit of long-lived hardware is worth the effort.
Parsing drift. In JavaScript, new Date("2026-10-30") is treated as UTC midnight, while new Date("2026-10-30T00:00") is treated as local midnight. Python's datetime.timestamp() on a naive datetime assumes the machine's local zone. Both behaviours are documented; neither is obvious at 2am.
Leap seconds. Unix time ignores them, so it drifts from astronomical time by a second or so over years. For logs and scheduling this rarely matters; for precise scientific timing, use a dedicated time standard.
Precision loss. Round-tripping through a float or a narrow integer column silently truncates values. Store timestamps in a column wide enough for the unit you chose, and keep the unit consistent across services.
Converting and checking a timestamp
The fastest way to decode a value is to paste it into a converter that shows both seconds and milliseconds, plus the ISO 8601 form in UTC. Our free timestamp converter runs entirely in the browser, so you can check log lines from a work machine without shipping data anywhere. Pair it with the cron explainer when a schedule and a timestamp disagree about when a job should have run.
When you convert by hand, work in this order: confirm the unit, convert to UTC, then apply the display timezone. If the result looks off by exactly one hour, suspect daylight saving. If it looks off by whole hours, suspect a fixed offset such as +05:30. If it is off by decades, suspect the unit. And if the number has decimal places, you are almost certainly looking at a duration, not a timestamp.
Frequently asked questions
Is a Unix timestamp always in UTC?
The number itself is timezone-free: it counts seconds since the epoch, which is defined in UTC. A timezone appears only when you format that number for display.
Why do I see 10 digits sometimes and 13 digits other times?
Ten digits is seconds, thirteen is milliseconds. JavaScript and some APIs use milliseconds; most command-line tools and many REST APIs use seconds. Check the length before converting.
Can a Unix timestamp be negative?
Yes. Negative values represent moments before 1 January 1970, and most modern libraries handle them correctly, though older 32-bit systems may not.
Paste a timestamp. Read the moment. No signup, no upload.
Convert Timestamp Free