pastesite.com New paste

Timestamps Another Person Can Reproduce

By · Published 2026-11-22 · reviewed 2026-11-13 · 2 min read

AI-assisted article. Reviewed by Codebuff automated editorial review on 2026-11-13. Examples are illustrative, not real user data.

A bug report that says the job ran at 02:15 gives the reader three candidates and no way to choose between them: the reporter's clock, the server's clock, or the value stored in the database. The difference is often the bug, and it is the first thing a reader has to reconstruct. Five extra characters, an offset, remove the ambiguity before anyone starts investigating.

Why is a bare time a riddle?

A time without an offset is a local time, and whose local time is a guess. The reporter saw 02:15 on their machine; the service logs 07:15 UTC; the database stores 07:15 with no marker at all. All three are the same instant, and a reader comparing two of them will conclude the job ran twice.

Say which clock you read the value from, not just the value. A log line, a browser devtools timestamp and a database column are three different observations, and the most common confusion in a scheduling bug is between the second and the third.

Include the offset, not just the zone name

Zone names are ambiguous in exactly the situations that produce bugs: an abbreviation can mean two different zones, and a named zone changes offset twice a year. An explicit offset is unambiguous for the instant it describes.

Keep the zone name as well when the behaviour depends on it, because the next occurrence of the same local time may have a different offset than this one.

# Ambiguous
job started 02:15, finished 02:44

# Reproducible
job started 2026-03-08T02:15:00-05:00 (America/New_York, UTC-05:00)
job finished 2026-03-08T02:44:00-05:00
note: local clock jumped forward at 02:00 -> 03:00 that morning

# The same instant, in UTC
started 2026-03-08T07:15:00Z, finished 2026-03-08T07:44:00Z

Wall clock is not elapsed time

If the question is how long something took, a wall-clock difference can be wrong: a clock adjustment, a daylight-saving change or a paused machine all make the elapsed time differ from the arithmetic. Report the duration the process measured when the duration is the point.

If the question is when something happened relative to another system, the wall clock is the right measure and the duration is not. Deciding which question you are asking is most of the work.

Write the format once, at the top

Put one line at the top of the report saying which format the timestamps below use and which clock they came from. Then every timestamp can be shorter, and nobody has to work out whether a value with a Z is a typo.

The same line is what makes the report searchable later. Someone looking at the same log weeks afterwards can compare the string directly instead of reinterpreting it.

Sources and editorial review

Prepared with AI assistance and checked against the logs and plain-text sharing pages at the reviewed revision: offset versus zone name, wall clock versus measured duration, and the single format line. The daylight-saving example is illustrative and not a claim about any particular runtime.