← All posts

Clock drift on a phone fleet

Sep 27, 2026 · By Xavier Fok

Clock drift on a phone fleet

The expensive part of a wrong clock is that nothing it breaks ever mentions time.

A handset forty seconds out of step does not raise a clock error. It raises a rejected login, an untrusted certificate warning, a log file that reads like a paradox, or a scheduled job that ran twice. All four of those point somewhere else, which is why this failure gets measured in days instead of minutes.

I rent a bit over a hundred physical Android handsets out of a room in Singapore, each with a carrier sim in it, with mobile proxy lines running on the same shelf. I have been through all four symptoms more than once and I have blamed the wrong layer first nearly every time.

A code is a sum, and the clock is one of the inputs

A time based code is generated offline. The app holds a secret it was given at enrollment, it reads the current time, and it hashes the two together into six digits that change every thirty seconds. The server holds the same secret and runs the same sum. Matching answers mean the two machines agree about what time it is, and that agreement is the only thing the scheme rests on.

Move the phone half a minute and the app computes the code for the wrong window. Nothing about the code is malformed. It is a real code for a moment the server is not standing in.

The server cannot see any of that. It compares six digits against six digits, they differ, and it returns the only message it has, which is invalid.

Most implementations accept one step either side of now, so a phone four or five seconds out never trips. That grace is why the onset looks random. You fail one login in ten, then one in three, then all of them, and the day it goes constant is the day somebody opens a ticket.

The diagnosis is where the money goes. A user who watches three codes get rejected in a row decides the enrollment is corrupted, and starts an account recovery that on some platforms means identity documents and a week of waiting. The secret on the device was correct the entire time.

Certificates read the same clock

A certificate carries two timestamps: the moment it becomes valid and the moment it stops. Every connection compares the device’s current time against both of them before it trusts anything.

A handset running behind rejects a certificate issued last week as not yet valid, because in that device’s version of events it has not been issued. A handset running ahead, which is what you get from a unit that sat powered down and came back sitting on its firmware build date, looks at a certificate with ten months left and calls it expired.

What the user sees is an untrusted connection page, or an app that refuses to sign in and gives no reason. Nothing on that screen says date.

Because the wording is about security, people reach straight for the network. They swap the proxy, then disable the proxy, then reinstall the app, then open a ticket with whichever supplier is easiest to blame. I have received that ticket. The device was eleven days behind.

Timestamps that argue

When something breaks across several devices you rebuild the sequence from timestamps. This happened, then that happened, so the second thing probably caused by the first.

That only holds if every device is counting the same seconds.

Two handsets forty seconds apart produce a story that rearranges itself. A response lands before its request. A job finishes before it starts. Two events that were genuinely simultaneous line up as cause and effect.

Nobody reads that as a bug. It reads as an explanation that does not quite hang together, and then the theory gets built around whichever device was lying.

Small drift is worse than large drift here. An hour is obvious enough that somebody catches it. Forty seconds is plausible, so it goes into the reasoning as a fact.

Schedules that miss, or repeat

Anything on a timer reads a clock to decide when to fire.

A phone running behind starts its overnight work late, which is survivable most nights. A phone that jumps forward when it finally reaches a network can skip its window completely: the job never runs, nothing errors, and no alert fires, because as far as the scheduler is concerned that time never existed.

Correct in the other direction and the device rolls backwards through a window it already passed, so the job runs a second time. Whatever the job does, it now does twice. If it posts, you posted twice. If it touches money, you touched money twice.

How a handset ends up wrong

Phones are good at this. A device with a working connection holds time well enough that you will never think about it.

It works because the phone is being told. The network hands over the time, the operating system treats it as authoritative, and the oscillator underneath gets corrected long before it wanders anywhere interesting. Remove the correction and you are left with a cheap crystal that was never meant to be right on its own. It drifts, and warm hardware drifts faster, and a shelf of phones is a warm place.

So the wrong ones are the ones that lost the correction for a while:

  • a unit that sat with no data on it for a stretch
  • a unit powered down in a drawer for three months
  • a unit fresh out of a factory reset that has not reached a network yet
  • a unit where somebody turned off automatic time on purpose

That last one is the most common cause on my shelf, by a distance. There is always a reason at the time. Testing something date sensitive, chasing a bug, working around an app that checks the calendar. The reason expires and the setting does not, and the device gets handed on looking completely normal while it has quietly stopped being told what time it is.

It leaves no trace anywhere except in the setting itself. Nothing logs it. No health check I have ever seen ships with it.

Time zone is a different problem in the same clothes

A device stores an instant, then draws that instant on the screen through a time zone. Two layers, and only one of them breaks things.

A wrong zone leaves the instant underneath correct. The phone knows exactly what moment it is. It is painting it eight hours away from where you are sitting.

So codes keep working, because the sum uses the instant. Certificates keep validating. Log lines stay in the right order and only carry the wrong label, which looks broken the moment you read them alongside another device.

The tell is that everything still works and only the display disagrees. Codes rejected means the clock. Codes fine but timestamps shifted by a whole number of hours means the zone. Getting that split right in the first minute saves an hour every time. I keep every device on the shelf reporting in one zone and let each screen say whatever it likes.

The check almost nobody runs

Every fleet monitor I have seen watches the same handful of things. Reachability, whether the app is alive, temperature, free storage. A clock check is missing from all of them.

It is one number. Ask the device for its time, compare it against the machine doing the asking, alert when the gap crosses a couple of seconds. That is the whole implementation.

I would trade half my existing checks for that one. When it fires, it names the fault instead of pointing at a symptom, and when it stays quiet it removes this entire family of failures from the suspect list before you start.

The reason it is missing is that a clock feels like the operating system’s job. It is the operating system’s job, right up to the moment the thing doing it cannot reach a network.

There is a companion rule that costs nothing at all. Authentication failing on several devices at once is a clock question before it is anything else. Multiple devices breaking the same way at the same moment is almost never a pile of separate account problems, and time is the shared thing that goes wrong without announcing itself.

What I got wrong

I wrote this check and then ran with it disabled for about four months.

The first version compared each phone against my own workstation, which is a laptop that sleeps. Every time I opened the lid the whole shelf looked wrong for a few seconds and I got a wall of alerts about nothing. So I turned the check off instead of fixing the reference, and it stayed off long enough to cost me one forty minute incident and at least two others I can name.

Fixing it properly took ten minutes: compare against a fixed source, ignore anything under two seconds, and only shout when a device stays wrong across several sweeps in a row.

What I cannot tell you is how far the fleet had drifted during those four months, because nothing was recording it. Every claim above about how often this happens on my shelf comes from the period after the check went back on, which is a shorter window than I would like. If you would rather rent handsets from somebody who watches the clock on them, that is what cloudf.one is.

Get new guides and videos first — join the Telegram channel.

40% off until 31 December 2026
Real phones in Singapore, each with its own mobile IP.
Introductory price until 31 December 2026. A dedicated phone straight away, no queue.