Unix timestamps
The Unix timestamp mode above - the default when you open this page.
Same number, four meanings: unit conventions by platform
The most common timestamp bug is a unit mismatch, because ecosystems disagree on the default:
| Environment | Unit | Example for the same instant |
|---|---|---|
Unix / C / PHP / Python time.time() | seconds | 1781250000 |
JavaScript Date.now() / Java | milliseconds | 1781250000000 |
| Some APIs (Stripe events) | seconds | 1781250000 |
Go UnixNano(), databases | micro/nanoseconds | 1781250000000000000 |
A quick sanity check: 10 digits ≈ seconds (current era), 13 ≈ milliseconds, 16 ≈ microseconds, 19 ≈ nanoseconds. If a date renders as 1970 plus a few weeks, you parsed milliseconds as seconds; if it lands tens of thousands of years out, the reverse.
Timestamps are UTC: display is local
A Unix timestamp has no timezone: it counts seconds since 1970-01-01T00:00:00 UTC, everywhere on Earth. Timezone only enters when formatting for humans. This is why storing timestamps (or UTC datetimes) and converting at the display layer is the architecture that survives daylight-saving transitions, server migrations, and users in multiple regions. Bugs blamed on “timezone issues” are usually a local time stored without its offset, unrecoverable ambiguity twice a year when DST clocks repeat an hour.
Leap seconds and why your math still works
UTC has had leap seconds inserted to track Earth’s rotation, but Unix time pretends they don’t exist, every day is exactly 86,400 seconds, and systems typically smear or step the clock when a leap second occurs. The practical consequence: subtracting two Unix timestamps gives elapsed civil time, which is what almost every application wants. Only scientific and astronomical software needs true elapsed seconds (TAI), and it doesn’t use Unix time for that.
Debugging checklist for date bugs
- Print the raw value and count digits, confirm the unit before anything else.
- Confirm the parser’s expected unit (
new Date(seconds * 1000)in JS). - Render in UTC first; introduce the user’s timezone only once UTC is correct.
- Test the DST boundaries for your display timezone (late March, late October in Europe).
- For future dates beyond 2038 on legacy systems, verify the storage type is 64-bit.
Timezones
The Timezone mode above, or jump straight to it.
The one rule that prevents timezone bugs
Store and transmit timestamps in UTC; convert to local time only for display. UTC never observes DST and never changes, so a UTC timestamp is unambiguous regardless of where the user is or what season it is. The moment you store local time, you’ve created a value that’s ambiguous (which “2:30 AM” during the fall-back hour?) and fragile across DST. Convert local → UTC on the way in, UTC → local on the way out. Use a Unix timestamp or an ISO 8601 string with a Z suffix (2026-01-15T14:30:00Z) for maximum portability.
Names, not abbreviations
Timezone abbreviations are a trap because they’re not unique. IST alone could mean Indian (UTC+5:30), Irish (UTC+1), or Israeli (UTC+2) Standard Time. CST spans Central US, China, and Cuba. The fix is IANA identifiers: Asia/Kolkata, Europe/Dublin, America/Chicago: which are globally unambiguous and encode each region’s full DST history. This converter uses IANA names under the hood, which is why it applies the correct offset automatically for the date you enter.
Offset vs timezone
| Concept | Example | Changes with DST? |
|---|---|---|
| UTC offset | UTC+3 | No, it’s a fixed number |
| Timezone | Europe/Istanbul | Yes, offset varies by season |
A timezone is a region with rules; an offset is a fixed shift. Europe/Berlin is UTC+1 in winter and UTC+2 in summer, same timezone, two offsets. Scheduling against an offset (UTC+1) loses the DST rules; scheduling against a timezone keeps them.
Why the date sometimes flips
When it’s 11 PM Monday in New York, it’s already Tuesday afternoon in Tokyo, so a conversion that changes the day is correct, not a bug. Timezones span more than 24 hours end to end (UTC−12 to UTC+14), so crossing the international date line shifts the calendar date. To measure spans between converted times, pair this with the Date Difference Calculator.