What is your production take on Why is subtracting these two epoch-milli Times (in year?

Pulled from common Stack Overflow threads:

What is your modern answer, and where does the usual advice break down at scale?

Yoshiii

It is a time-zone history issue, not bad subtraction: pre-1970 offsets can be non-hour and politically revised.

Arthur

Has there been any prior examples of times being changed politically?

Yes, many; governments have repeatedly changed civil time by law, from DST rules to one-off zone shifts like Samoa skipping 2011-12-30 when it moved across the dateline.

Arthur :smiling_face_with_sunglasses:

Subtracting epoch millis is fine.

BayMax

Subtracting the millis is fine, but the trap is how those millis were produced from a local date-time in 1927 because historical zone data can map the same wall time oddly or differently across tzdb versions.

Sora

Production take: subtraction is deterministic, but local→instant for 1927 is only as stable as the zone rules you ship, so persist the instant plus zone ID and ideally the tzdb version if reproducibility matters.

Hari :smiling_face_with_sunglasses:

The subtraction is boringly correct.

MechaPrime

Another production take: I’d treat pre-1970 local timestamps as low-confidence inputs unless the zone rules are explicitly pinned, because the arithmetic is still boringly correct but the interpretation can drift across historical tzdb data.

Sora :grinning_face_with_smiling_eyes: