跳至正文

Timestamp Tool vs Adding 8 Hours by Hand

Unix timestamps don’t carry a time zone, so there is nothing to add or subtract by hand. On ToolPug’s date to timestamp page the dropdown only tells the parser how to read the clock digits you typed, and the answer comes back as three lines: s, ms and utc. That holds for all 64 zones in the list, and it stops holding at daylight-saving gaps and at years below 100.

Does the time zone dropdown change the timestamp?

It changes how your digits are read, not the instant they point at. Set the field to 2024-01-01 00:00 with UTC and the date to timestamp converter returns s: 1704067200, which is 2024-01-01T00:00:00.000Z. Keep the digits, switch to Asia/Shanghai, and you get 2023-12-31T16:00:00.000Z with s: 1704038400 — 28800 seconds lower.

So the number coming out is already UTC. You never add 8 hours yourself; you pick the zone you were thinking in and let the page subtract it.

What people expectWhat the page doesNumber you get
Add the offset firstReads digits in the zone you picked1704038400 for Shanghai
ms is a second resultSame instant, times 10001704067200000 next to 1704067200
A nonexistent local time is refusedResolves it silentlyNew York 2024-03-10 02:30 becomes 01:30
Years 1–99 convert as typedThey land in 1900–19990001-01-01 comes back as 1901-01-01

Why does 02:30 in New York come back as 01:30?

That clock time doesn’t exist — the US spring transition jumps from 02:00 to 03:00. The parser solves for an offset, settles on 06:30 UTC, and that reads back as 01:30 EST, with no warning. When converting a scheduled event across a DST boundary, read the utc line.

The year case is a JavaScript quirk, not a time zone one: 0000–0099 are mapped to 1900–1999, so 0001-01-01T00:00 returns -2177452800. From 0100 onward the conversion is literal. I tested both by lifting the page’s own parsing function out of its script and running it under Node, and it matched the page figure for figure.

What can’t this page do?

  • One direction only. It won’t turn 1704067200 back into a date.
  • Minute precision. The picker steps 60 seconds, so no half-seconds.
  • One date at a time. No batch, no file import.
  • No download. Copy result is the way out.

Features and parameters match the toolpug.com tool page as of November 2026.