Home / Methodology
How Dwelltime counts days and checks its rules
Dwelltime is a day counter for visa limits, tax-residency tests and residence or citizenship presence requirements. It is built by RA2 LAB, a small independent app studio. This page explains where every number on this site comes from, how the counting engine was tested against an official calculator, and what we do not claim.
One engine, the same everywhere
Every calculator on this site and every counter in the iOS and Android app runs the same code: a counting engine written once, in plain Dart, with no user interface in it. The web calculators are that engine compiled to JavaScript, so a figure you see here is the figure the app would show for the same trips.
Most day-count rules are the same arithmetic with different constants: a region, a window (each visit, a calendar year, or a rolling window such as 180 days), a threshold, and a direction — a ceiling you must stay under, or a floor you must reach. The engine models a rule as exactly those fields, so adding a country is a new row in a table, not new code.
Checked against the European Commission's calculator
The Schengen 90/180 rule is the one rule with an official reference implementation: the European Commission's short-stay calculator. We transcribed its arithmetic and ran it on 409 trip histories — 9 hand-picked edge cases and 400 random ones — and the engine must agree with it on every one:
- the rolling 180-day total on every single day of each history (about 60,000 day-level comparisons);
- the number of consecutive days still available;
- whether the history is legal and, if not, the first day it breaks the rule.
The generic rule type that powers the other rules is held to the same test: Schengen expressed as a plain rule row must reproduce those results exactly. That is how a check on one rule carries over to the arithmetic of all of them.
Two other rules have their own references: the US substantial presence test is checked against the worked examples in IRS Publication 519, and the UK Statutory Residence Test, which counts midnights rather than days, against the tables in HMRC's RDR3 guidance.
Every rule cites a government source — and the link is checked
Each rule in the rulebook names the authority and the page it was read from: a tax authority, an immigration department, legislation, or EUR-Lex. A script fetches every one of those links; a link that returns an error fails the build, because a citation that no longer resolves is worse than none — it looks checked when it is not.
Statutes are translated carefully. A law that says "resident if present 183 days or more" is a ceiling of 182 for someone trying to stay non-resident, because the 183rd day already makes them resident. The engine does that conversion in one place so no rule can get it wrong on its own.
How the rule pages are written
The thresholds, windows and calculators on each rule page come straight from the engine's rule table. The plain-English explanation around them — the tests, exceptions and questions — is drafted with AI assistance from the official sources listed at the bottom of each page, and every page lists those sources and the date it was last reviewed against them. If an explanation and the official source ever disagree, the official source wins; please tell us at admin@ra2lab.io and we will fix the page.
Three counting principles
- Never invent a day. A day nobody recorded stays empty. The app can suggest days from photos or fill a gap only when you ask, and those days are not counted until you confirm them.
- Unknown is not "no". A day recorded only as "United States" cannot answer "were you in New York?" — it is reported as unknown, not counted as a day outside the state.
- Every day is traceable. Each counted day carries where it came from — a trip you entered, a stamp, a confirmed photo — so the total can be explained day by day and corrected in one tap.
What we do not claim
Dwelltime counts days. Residency, tax and immigration outcomes usually depend on more than a day count — domicile, ties, treaties, visa conditions and an officer's discretion. Nothing on this site is legal, tax or immigration advice. Rules change; confirm with the official source and a qualified professional before relying on any figure.
Know where you stand
Every limit tracked, every day counted, every uncounted day explained. Export ready when you need it. Private by design.