Timestamp Gap Analyzer

How long was the machine idle between run four and run five? The answer is sitting in a column of timestamps that nobody wants to subtract by hand forty times, which is exactly why the one gap that mattered went unnoticed.

YYYY-MM-DD HH:MM or HH:MM:SS, or MM/DD/YYYY HH:MM. A trailing Z or an offset such as +05:30 is honoured and overrides the zone below. Anything after a comma is kept as a label.
Timestamp Gap Analyzer — Intervals Between a List of Log TimesBuildFigure

What the parser accepts, and what it refuses

Two shapes are read: an ISO-like 2026-03-07 21:40:00 with either a space or a T between the date and the time, and a US 03/07/2026 9:40 PM. Seconds and fractional seconds are optional. Anything after the first comma is kept as a label so a pasted CSV column works without cleaning.

A trailing Z or an explicit offset such as +05:30 is honoured and overrides the zone selector for that line, which means a file mixing UTC-stamped machine output with locally-stamped human notes still measures correctly. Lines without either are read as local time in the zone you pick.

A bare date with no time is refused. It would have to be assumed to mean midnight, and that assumption does not announce itself — it just shifts every interval touching that line by up to a day. Rejecting it loudly is the smaller cost.

Sorting is a decision, not a tidy-up

Log files are not always in time order. Multiple writers, buffered output and clock skew between machines all produce lines that arrive out of sequence. That leaves you with a choice this tool cannot make for you.

Sorted, the intervals describe what happened in the world: the gaps are all positive and the table reads as a timeline. Unsorted, the intervals describe the file: negative gaps appear exactly where the ordering broke, which is often the thing you were looking for. The count of out-of-order lines is reported either way, so you can turn sorting on for the timeline and off again to find the misbehaving writer.

Repeated timestamps show up as zero-length gaps and are counted separately. In machine output that usually means one event was emitted twice; in hand-kept records it usually means a copy-paste.

The gap that is not the gap

Every interval is computed from epoch instants, so it is real elapsed time. Where that differs from what a reader would get by subtracting the printed digits, the note column says so and gives the wall clock figure as well.

This happens across a daylight saving transition. A pair of stamps written 21:40 and 04:00 the next morning look six hours and twenty minutes apart, and across a spring-forward night they are five hours and twenty minutes apart. If you are measuring machine work, the elapsed figure is the one you want. If you are reconciling against something a person wrote on a form, the wall clock figure may be what they meant. The datetime difference calculator takes a single pair apart in more detail, and daylight saving change dates tells you exactly when the transitions fall for a zone.

Reading the summary without over-reading it

The mean gap is the total span divided by the number of intervals, so a single long outage drags it upward and makes a regular process look irregular. The median ignores that outage entirely and describes the typical interval instead. When the two are far apart, the distribution has a tail and the mean on its own will mislead whoever reads your summary.

The flag threshold is there to answer a narrower question: how many gaps were longer than something you consider acceptable. Set it to the interval your process is supposed to keep and the highlighted rows are the exceptions. Set it to zero to switch the flagging off.

The bottom box holds the whole interval table as tab-separated text, ready to paste into a spreadsheet where you can chart it. If instead of measuring existing stamps you want to generate a series of them, the date list generator works from the other direction, and work time log tally handles the specific case of paired in-and-out punches.

Questions people ask

Can it read a mix of UTC and local timestamps in the same paste?

Yes. Any line ending in Z or in an explicit offset such as +05:30 is interpreted with that offset regardless of the zone selector. Lines without one are read as local time in the selected zone. That combination is common in exported logs where the machine writes UTC and a person appends a note in local time.

Why is one of my gaps an hour shorter than the arithmetic suggests?

Because a daylight saving transition falls inside it. The gap column reports real elapsed time; the note column shows what the wall clock difference would have been. Both are shown precisely so the discrepancy is visible rather than being quietly absorbed into one number.

What does a zero-length gap mean?

Two consecutive timestamps are identical to the resolution you supplied. If the source had fractional seconds and you trimmed them, the events may have been milliseconds apart rather than simultaneous. If the source had no sub-second precision to begin with, a duplicate emit is the more likely explanation.

Should I leave sorting on?

Leave it on when you want a timeline of what happened. Turn it off when you are investigating the file itself — unsorted, a negative gap marks the exact line where ordering broke, which sorting would hide. The out-of-order count is reported in both modes.

Is there a limit on how many lines it will take?

It stops at 5,000 lines and says so rather than freezing the tab. Everything runs locally in one synchronous pass, so the practical constraint is how long your browser will spend without repainting. Well under that limit the result is immediate.

Related