01970-01-01 00:00:00 GMT+00:00About Unix Timestamp Converter
When investigating production incidents you constantly need to turn the number in a log line into something human: what date and time is 1664582400, why does the millisecond timestamp in the report have three more digits than the second one, and is that API response eight hours off. A timestamp converter handles this numeric-to-readable round trip, which is a several-times-a-day action. Unix time is defined as the number of seconds since 1970-01-01T00:00:00Z. It is inherently UTC and carries no timezone; a timezone only enters when formatting it into a string for people. That is the starting point for every time bug: storing timestamps and rendering them per user timezone is correct, whereas storing local wall-clock time as if it were a timestamp guarantees multi-hour drift across regions. Practical notes: First decide whether the number is seconds or milliseconds, since ten digits usually means seconds and thirteen usually means milliseconds, and guessing wrong shifts the result by tens of thousands of days. Always format with an explicit timezone instead of the runtime default, or the same code prints different values on a laptop and on a server. For machine exchange use ISO 8601 with a Z or explicit offset, never a local format. Limits: A signed 32-bit timestamp overflows on 2038-01-19, a limit still present in legacy systems and some embedded databases, so long-lived storage should use 64 bits from the start. Daylight saving makes the same local time occur twice or not at all on transition days, so schedules that must run at a fixed moment have to be anchored in UTC rather than local time. Leap seconds are flattened in the Unix scale (every day is exactly 86400 seconds), so timestamps drift from physical time by seconds and high-precision measurement should use a monotonic clock. Data and privacy: a timestamp itself is not sensitive, but it usually travels with user activity logs, order times and access records, and a single timestamp plus business context can identify a person. This tool converts in the browser, the input is never sent anywhere, and it works offline. A few practices that save enormous debugging time across systems. At the database layer, PostgreSQL timestamptz converts per session timezone while MySQL DATETIME stores verbatim and TIMESTAMP converts, so decide which semantic you need up front or the same row shows different values on connections with different timezones. At the API layer, always return ISO 8601 with Z or an explicit offset, or encode the unit in the field name such as created_at_ms, so callers never have to guess. In logging, record UTC uniformly on the server and convert at the presentation layer, which prevents entries from multiple regions sorting out of order. Presentation is the opposite case: user-facing times should be converted into their own timezone and expressed relatively where it helps, since "yesterday 23:40" reads better than a full date. Writing "store in UTC, display in local time" into your engineering conventions is far cheaper than correcting it case by case afterwards. Combined with scheduling there is one more trap: cron expressions are interpreted in the server's local timezone, and container base images usually run UTC, which yields "the job runs in the morning locally but at midnight in production". Bake the timezone explicitly into the image or configuration instead of relying on the default. Writing the timezone into both the API documentation and the database column comment is the cheapest way to stop the next maintainer from repeating the mistake.
How It Works Internally
A timestamp is the number of seconds since 1970-01-01T00:00:00Z; it is inherently UTC and carries no timezone, which only enters when formatting to a string. Ten digits usually means seconds and thirteen usually means milliseconds, a factor of a thousand, so misjudging it shifts the result by tens of thousands of days. Store timestamps and render per user timezone — that split never goes wrong.
16645824002022-10-01T00:00:00Z (UTC) = 2022-10-01 08:00:00 in UTC+8Measured on This Page
| UTC correct | 0 → 1970-01-01 00:00:00, 1700000000 → 2023-11-14 22:13:20, 2000000000 → 2033-05-18 03:33:20, all matching Python |
|---|---|
| Seconds/milliseconds detection | 1700000000000 (13 digits) is detected as milliseconds and yields the same instant as 1700000000 — digit count is the heuristic (10 = seconds, 13 = milliseconds) |
| Timezone switching | The same instant renders in UTC or any zone, with offsets computed via Intl formatToParts rather than string slicing (avoiding the Unicode minus sign and single-digit hours that break naive regexes) |
| Local timezone init | The first frame shows the local zone while still matching between SSR and client, avoiding hydration mismatches |
Three timestamp fundamentals: a Unix timestamp is itself UTC and carries no timezone — timezones only enter when formatting; 10 digits usually means seconds and 13 milliseconds, but that is a heuristic that starts to slip once second-based stamps grow to 11 digits after 2050; and Beijing is UTC+8, so the same stamp displays eight hours apart — the classic 'the API returns a time eight hours behind' bug is usually a UTC value rendered as local time (or the reverse).
How to Use
- Open the Timestamp Converter tool
- Enter a Unix timestamp (seconds or milliseconds) or select a date/time
- Automatically converts to human-readable date and ISO 8601 format
- View timezone information and relative time
- Supports batch conversion: one timestamp per line
Use Cases
- Read log times — Convert a Unix timestamp from a log into a local date to pinpoint when an event happened.
- Debug time zones — Toggle one timestamp between UTC and local to spot an offset problem.
- Build test values — Convert a chosen date to a timestamp for boundary tests in APIs or databases.
- Check expiry — Turn a token or cache expiry timestamp into a date to see if it has lapsed.
- Tell ms apart — Decide if a number is seconds or milliseconds to avoid a 1000x error.
- Schedule cron jobs — Convert a human-readable schedule to a Unix timestamp for testing cron trigger logic.
- Migration ordering — Turn a migration file's timestamp prefix into a readable date to verify the ordering of pending migrations.
FAQ
How does it tell seconds from milliseconds?
It judges by digit count: 10 digits is usually seconds, 13 is usually milliseconds. You can also set the unit manually to prevent misreads.
What is the Unix epoch?
Time elapsed since 1970-01-01 00:00:00 UTC, independent of time zone; the offset is applied only when displaying in your chosen zone.
Are negative timestamps supported?
Yes. Negative values represent times before 1970, useful for converting earlier historical dates.
Does the year 2038 problem affect it?
The 2038 issue stems from 32-bit signed overflow. This tool uses a wider numeric range, so dates beyond 2038 convert fine.
Does my computer time zone affect the result?
It displays in your selected zone. Choosing local ties output to system settings; pick UTC explicitly when debugging to avoid ambiguity.
Why is the API time 8 hours off from my local time?
Almost always a timezone matter: the API stores UTC while you view in your local zone (China is UTC+8). First confirm the unit — seconds vs milliseconds — then compare both in UTC. If the field ends with Z or says Utc, the source is UTC. Pin one timestamp in this tool and switch it between UTC and local side by side: if the gap is a whole number of hours, it is a timezone mismatch, not corrupted data, so fix the convention used at storage or display.
Why do seconds and milliseconds display different times for the same value?
The unit is wrong. Seconds are usually 10 digits, milliseconds usually 13: feeding seconds into a millisecond field gives a time near 1970, and the reverse shifts by roughly a millennium. Languages like JS Date.now() and datetime(3) columns return milliseconds, while many logs and shell tools like date +%s return seconds. When unsure, look at the digit count or calibrate against a known reference timestamp, then convert in the correct unit.
Is the timestamp 10 or 13 digits?
10 digits is seconds; 13 is milliseconds (JavaScript Date.now() emits milliseconds). Parsing milliseconds as seconds lands you in the year 50000, and the reverse lands in 1970. The tool usually detects the length, but 11–12 digit edge cases need the unit set manually.