What Is a Unix Timestamp? Seconds, Milliseconds & Time Zone Conversion
Reading logs or calling APIs, you constantly run into 10- or 13-digit numbers like 1727222400. That's a Unix timestamp: the number of seconds (or milliseconds) since January 1, 1970, 00:00 UTC. It's the computer world's universal time language.
But human brains don't translate 1727222400 into "September 25, 2024" on sight. This article explains the conversion logic, with a free converter at the end.
Seconds vs milliseconds: a 1000× trap
A 10-digit number is a second-level timestamp (e.g. 1727222400); a 13-digit one is millisecond-level (e.g. 1727222400000). They differ by a factor of 1000 — the most common beginner trap: treat a millisecond stamp as seconds and you land in 1970; the other way around lands you tens of thousands of years in the future.
Memory aid: seconds are 10 digits, milliseconds are 13. Java's System.currentTimeMillis() and JavaScript's Date.now() return 13-digit millisecond stamps; Python's time.time() and PHP's time() return seconds (float or integer). Check which unit the API docs ask for before integrating.
Converting timestamps to Beijing Time
Conversion is two steps: turn the timestamp into UTC time, then add 8 hours for Beijing Time (UTC+8). For example, timestamp 1727222400 is 2024-09-25 00:00:00 UTC, which is 2024-09-25 08:00:00 Beijing Time.
The time zone step is where manual math usually goes wrong: people forget the 8-hour offset, get a result "off by 8 hours," and blame the tool — when really UTC and Beijing Time are simply 8 hours apart. When using a converter, confirm its output is in Beijing Time (UTC+8).
- Confirm whether the timestamp is 10 digits (seconds) or 13 digits (milliseconds).
- Paste the number into the converter's timestamp input — the tool auto-detects the unit.
- Click convert to get Beijing Time in YYYY-MM-DD HH:mm:ss format.
- Reverse: pick a date and time in the date picker to get both second- and millisecond-level timestamps in one click.
Open the free "Timestamp Converter" tool — runs locally, no sign-up.
Common uses of timestamps
One: API signatures — many APIs use timestamps as a request "expiry" check to prevent replay attacks. Two: log ordering — comparing numbers is far faster than comparing date strings, so logging systems record events as timestamps. Three: cache expiry — e.g. "token expires in 2 hours" is stored as "current timestamp + 7200".
Once you understand timestamps, reading logs and debugging "why does my request say expired?" gets much smoother: convert the timestamp in the log and you'll know exactly which second went wrong.