Open the console

Onboarding Steps That Depend on Account Timezone

When a checklist step has a deadline or a schedule, the user's local time and the server's clock disagree sooner than you expect.

Onboarding Steps That Depend on Account Timezone

Most onboarding steps are instantaneous: click, confirm, done. A few are not. A step that says "verify your domain within 24 hours" or "schedule your first import for tonight" has a clock attached to it, and that clock means something different depending on who is reading it. The server knows UTC. The user knows whatever city they are sitting in. If you render the deadline in the wrong one, the step looks broken even though nothing failed.

Where the mismatch actually shows up

It is rarely the main screen. The checklist usually renders a relative label like "expires in 18 hours", which is timezone-agnostic by accident — it is a duration, not a point in time, so it survives translation. The failure shows up in the places that print an absolute time: a confirmation email ("your window closes at 11:00 PM"), a reminder notification, an audit log entry, or a support reply that quotes "completed at 14:32" without saying whose 14:32 that is.

The second place it shows up is scheduling itself. A step that lets a user pick "when this should run" is collecting a wall-clock time in their head and storing it as a timestamp in yours. If the stored value is naive — no offset attached — the gap between those two clocks is baked into the record permanently, and it only becomes visible months later when someone changes timezone or the account is read by a different service.

Store the offset, not just the instant

The fix that holds up is boring: every timestamp a step writes carries an explicit UTC offset, and every timestamp a step reads is converted before it is shown. That means the account record needs a timezone field, and it needs to be the IANA name (Europe/Paris, not CET), because IANA names carry daylight-saving rules and three-letter abbreviations do not.

type Account struct {
    ID       string
    Timezone string // IANA name, e.g. "Europe/Paris" -- never a fixed UTC offset
}

func (a Account) Localize(t time.Time) (time.Time, error) {
    loc, err := time.LoadLocation(a.Timezone)
    if err != nil {
        return t, err // fall back to UTC and say so, don't guess
    }
    return t.In(loc), nil
}

The important part of that fallback is the second half: when the lookup fails — an empty field, a typo, a timezone the runtime's database does not know — show UTC and label it as UTC. A silently wrong local time is worse than an honestly labeled UTC one, because the wrong local time looks correct until someone acts on it.

Where the timezone comes from

Three sources, in order of reliability: an explicit choice the user made in account settings, the Intl.DateTimeFormat().resolvedOptions().timeZone read in the browser at signup, and an IP-based guess as a last resort. The browser read is cheap and usually right, but it is a snapshot — a user who signs up on a work laptop in one city and finishes onboarding on a phone in another will have a mismatch for exactly as long as it takes them to open account settings and notice. That is a real but small cost; do not solve it by re-detecting on every request, which trades a rare visible mismatch for a step whose deadline silently moves.

If the product already asks for a billing region during signup — the same moment currency and locale can disagree — that is a natural second place to confirm or correct the detected timezone, not a new question to ask separately.

Scheduled steps need a server-side clock, not a client-side countdown

A step that completes itself at a future time — "your import will run at the time you picked" — should be evaluated by whatever runs on your server's schedule, in UTC, against the stored offset-aware timestamp. Do not let the browser's countdown be the thing that fires the completion; a tab left open with the wrong system clock, or simply closed, will make the step look stuck when the real job already ran, or complete when it has not.

If completion is driven by something that finishes later rather than by the request that started it, the same separation of concerns applies to background-job-driven steps: the job is the source of truth, the UI is a display of that truth, and the two should never both think they own the deadline.

What to measure instead of guessing

No number here is safe to invent — not how often users mis-set a timezone, not how many support tickets trace back to this. What's worth instrumenting is a single comparison: at the moment a time-bound step is shown, log the account's stored timezone against the browser's detected timezone for that session. If they disagree, that's the mismatch this article is about, happening in production, not in theory. A rate near zero means the problem is small; a rate that climbs after a change to signup is a regression you caught before a support ticket did.

Until that comparison exists, treat every time-bound step as a candidate for the bug, and default new ones to relative language ("in 24 hours") instead of absolute clock time wherever the UI can get away with it. See the docs for how step metadata is structured if you're adding a deadline field.

Try it on your app