Unix Time and the 2038 Problem, What a Timestamp Really Is
Unix, epoch, time is a single number. How many seconds have elapsed since 1970-01-01 00:00:00 UTC, ignoring leap seconds. It is deliberately timezone-free, it names one absolute instant, and converting that instant into a wall-clock date is a separate step that needs a zone. That one idea explains most timestamp confusion, from the classic 10-versus-13-digit bug to the looming-but-quiet 2038 overflow.
The epoch converter turns a timestamp into a readable date, or the reverse, supports both seconds and milliseconds, and shows the result across timezones. This guide explains what epoch time actually counts, why a 32-bit signed integer runs out on a specific Tuesday in 2038, and the storage habits that avoid the whole class of errors.
Epoch zero and the second counter
Timestamp 0 is the instant 1970-01-01 00:00:00 UTC. Positive numbers count seconds forward and negative ones count back before it. A 2020s-era value sits around 1.7 billion, not a coincidence, just seconds since 1970. Because it is one monotonic integer, it is ideal for comparing and sorting instants, which is why systems store it instead of a formatted string.
The catch is human reading. 1700000000 tells a person nothing, so you always format it with a zone, and formatting in local time is where two people can disagree about the same instant.
Seconds versus milliseconds, the digit-count bug
Systems disagree on the unit. JavaScript's Date.now() and many APIs return milliseconds, 13 digits, while classic Unix time is seconds, 10 digits. Feed a 13-digit millisecond value into something expecting seconds and you get a date in the far future. Feed seconds into a milliseconds parser and you get a date near 1970. This single mismatch causes an outsized share of timestamp bugs.
The converter exposes a seconds or milliseconds choice so you decode the right unit explicitly instead of guessing from the digit count. When storing, be consistent about which one you keep, and label it.
UTC versus local time
A timestamp is an instant, but a formatted date is a view of that instant from some zone. The robust habit is to store and compute in UTC and only convert to a local zone at display time, because storing local times loses information, and is ambiguous across daylight-saving changes. The converter's multiple-timezone output exists precisely so you can see the same instant rendered correctly wherever the user is.
| Value | Represents, UTC |
|---|---|
| 0 | 1970-01-01 00:00:00, epoch zero. |
| 2147483647 | 2038-01-19 03:14:07, last time in a 32-bit signed seconds field. |
| 2147483648 | overflows a signed 32-bit int, wraps to 1901-12-13 20:45:52. |
| 4294967295 | 2106-02-07 06:28:15, last time in a 32-bit unsigned seconds field. |
The two landmark bounds bracket the 2038 problem. A signed 32-bit seconds counter simply cannot name a moment past 2038-01-19 03:14:07 UTC, and on the next second it rolls backwards.
Why 2038, and where it still bites
The 2038 problem is a fixed-width integer overflow. Time stored as a signed 32-bit number of seconds tops out at 2147483647, 2038-01-19 03:14:07 UTC, after which it wraps to a negative value and the date jumps to 1901. It is not a distant theoretical worry for modern 64-bit systems, but it is real for legacy 32-bit hardware and firmware, old file formats, embedded devices, some databases that store time in a 32-bit INT column, and any code compiled on a 32-bit platform.
The fix is boringly good practice. Store time in a 64-bit field, which reaches roughly 292 billion years, effectively never, or in a fixed string/UTC format, and audit old systems and schemas for 32-bit time columns before they meet 2038 data.
Leap seconds and the honest caveat
Unix time pretends every day is exactly 86,400 seconds and ignores leap seconds, so a UTC minute that really contained 61 seconds is represented as if it had 60, the extra second is handled by smearing or repeating a value. For almost every application this is invisible and harmless. Only precision timekeeping, trading or telecom systems need to care, and they use TAI or explicit leap-second tables rather than raw epoch seconds.
For everyday work, use the converter to translate an epoch value into UTC and your local zone, and the date calculator when you need to add or subtract calendar days rather than raw seconds.
Frequently Asked Questions
What is a Unix timestamp exactly?
The number of seconds since 1970-01-01 00:00:00 UTC, ignoring leap seconds. It names one absolute instant with no timezone, so the same number means the same moment everywhere. Only formatting it into a readable date requires a zone.
Why does my converted date show the year 50000?
Almost certainly you read milliseconds as seconds. A 13-digit millisecond value interpreted as seconds is about 1000 times too large, pushing the date millennia forward. Tell the converter the input is milliseconds so it divides correctly.
Is the 2038 problem going to break my modern server?
Probably not directly, modern 64-bit systems do not overflow. The risk is legacy 32-bit systems, embedded firmware, old file formats, and database columns that store time as a 32-bit INT. Audit those before you start writing post-2038 dates into them.
Should I store time in UTC or local?
Store and compute in UTC, display in the user zone. Local times lose information and are ambiguous across daylight-saving changes, so converting an epoch value to a formatted local string should happen only at display time.
Does Unix time handle leap seconds?
No. It assumes 86,400 seconds a day, so a UTC minute with a leap second is represented as if it had 60 seconds, and the second is smeared or repeated elsewhere. Everyday apps are unaffected. Only precision time and trading or telecom systems need true leap-second handling.
What does a negative timestamp mean?
A moment before the epoch. -1 is one second before 1970-01-01 00:00:00 UTC. That is valid and common when converting old historical dates, and it is exactly the value a 32-bit signed counter would snap to when a post-2038 time overflows past its maximum.