Chapter 19 · Reading 2 of 3
Scripts another examiner can rerun
CHFI domains 1, 4, 5, 6
To settle the Pell River question in a way the defense can test, the academy writes a short script that reads the raw visit time from a copy of the History database, converts it to UTC and prints the result with the input’s hash. Anyone with the same copy and Python can run it and get the same output. That is the point.
Timestamps are a count from an epoch
Most digital timestamps are a count of units since a fixed starting moment, called the epoch. Tools disagree when they assume the wrong epoch, the wrong unit or the wrong time zone, and all three mistakes produce plausible-looking dates.
| Format | Unit | Epoch (UTC) | To Unix seconds |
|---|---|---|---|
| Unix time | Seconds (sometimes ms) | 1970-01-01 | As is (÷ 1,000 for ms) |
| Windows FILETIME | 100 nanoseconds | 1601-01-01 | ÷ 10,000,000, then − 11,644,473,600 |
| WebKit / Chrome time | Microseconds | 1601-01-01 | ÷ 1,000,000, then − 11,644,473,600 |
| Mac absolute time | Seconds (iOS messages: ns) | 2001-01-01 | + 978,307,200 |
The two offsets are worth remembering. There are 11,644,473,600 seconds from 1601 to 1970, and 978,307,200 seconds from 1970 to 2001. The same moment, 14:21:08 UTC on 26 November 2026, is 1,795,702,868 in Unix time, 13,440,176,468,000,000 in WebKit time and 134,401,764,680,000,000 as a FILETIME.
A script built to be checked
The academy’s script uses only Python’s standard library, so there is nothing extra to install or trust. Each line does one visible thing.
import hashlib, sqlite3, sys, datetime as dt
path = sys.argv[1]
digest = hashlib.sha256(open(path, "rb").read()).hexdigest()
print("input sha256", digest)
db = sqlite3.connect(f"file:{path}?mode=ro", uri=True)
for url, raw in db.execute(
"SELECT urls.url, visits.visit_time FROM visits "
"JOIN urls ON urls.id = visits.url WHERE urls.url LIKE ?",
("%drawings/PRB-114%",)):
unix = raw / 1_000_000 - 11_644_473_600
print(raw, dt.datetime.fromtimestamp(unix, dt.timezone.utc).isoformat(), url)
- Hash the input first, so the output names exactly which copy of the database it came from.
- Open the copy read-only through a URI, so the script cannot change it.
- Convert WebKit microseconds to Unix seconds with the fixed offset.
- Print the raw value next to an explicit UTC time. Never let the script fall back to the computer’s local time zone.
The output shows 13440176468000000 2026-11-26T14:21:08+00:00 beside the portal URL. The raw value is printed alongside the conversion so that a reviewer can recompute it without trusting the script at all.
Making it reproducible
- Keep scripts in version control and record the commit used for each case.
- Record the Python version and the operating system.
- Test the script against a fixture first: the academy’s chrome-time-03 database, whose 50 visit times are known, must produce 50 exact matches.
- Handle exceptions visibly. A record that cannot be parsed is printed as an error with its row ID, never skipped.
- Save the full output, hashed, with the case notes.
On the exam, know each format’s unit and epoch, the 1601 and 2001 offsets, and why scripts open evidence copies read-only, hash their inputs and print raw values with explicit UTC. The next reading, Automation, AI and the reproducibility package, scales this up to whole pipelines and AI-assisted review.
Inspect the three records, then use the evidence to answer the question.
1. Unit
100-nanosecond intervals
2. Epoch
1 January 1601 UTC
3. Offset
11,644,473,600 seconds from 1601 to 1970
Apply the reading
Why should a script open a copy of the browser database read-only, and log the SHA-256 of that copy before it runs?
Compare your reasoning
Opening the database read-only prevents the script from changing it, and the hash proves which exact input produced the results, so another examiner can confirm they are rerunning the script on the same data.