An epoch integer is a moment stored as a plain count of seconds from a fixed origin, with no separators and nothing in it announcing that it is a time.
The shape
This is the form a machine keeps and occasionally leaks onto a page. It is one number. It counts elapsed seconds from an agreed starting point, and because the starting point is agreed rather than written down anywhere in the value, the value on its own is just a number of a certain size.
- Alphabet
- digits only. A sign is permitted at the front and nothing else appears anywhere
- Width in seconds
- ten digits for the moments people currently deal with
- Width in milliseconds
- thirteen digits, being the same count with three more digits on the end
- Sign
- a leading minus means a moment before the origin. It is legal, it is rare, and it is often mishandled
- Grouping
- none. No thousands separators, no spaces, no underscores
- Leading zeros
- absent in practice, because the value is written as a number and numbers do not carry them
ten digits: a count of seconds
0123456789
thirteen digits: the same count in milliseconds
0123456789012
a moment before the origin
-0123456789That last note is worth keeping. Because the value is a number, the first digit of a real one is never a zero, and the placeholders above are recognisable as placeholders for exactly that reason. It is also the only feature of this shape that is visible at a glance without counting anything.
Ten digits or thirteen, decided by eye
The single most useful thing you can do with one of these is count its width. Ten digits and thirteen digits are the two common cases, they differ by a factor of a thousand, and the difference between reading one as the other is roughly the difference between a moment in this decade and a moment far outside it.
You do not need to know what the number decodes to. You need only to notice which of the two widths you have, because a value handed to something expecting the other width produces a result that is wrong by an enormous margin and yet perfectly well formed. That is the failure mode this shape is prone to.
A count of digits is genuinely enough. Ten, thirteen, or something else that means you are probably not looking at a time at all.
The collision with other numbers
Here is the honest limitation of this card. An integer in this shape is indistinguishable from any other integer of the same width. A numeric reference, a record identifier, a counter, a quantity: all of them are runs of digits and none of them is marked.
So context does all the work. If a number appears in a column headed with a word about time, it is probably a time. If it appears beside a description of a purchase, it may well be a reference instead, and an order reference is documented separately for that reason. Neither reading is available from the characters.
This is the clearest example on the whole site of a shape that filters almost nothing. It excludes strings with letters in them. That is the entire contribution.
How to check it by eye
Deciding the width before deciding the meaning
- Count the digits in threes from the right. Ten and thirteen are easy to tell apart once grouped, and grouping ten digits gives you one, then three, then three, then three.
- Check the first character for a minus sign. If it is there, the moment is before the origin, and any tool that quietly discards the sign will land you somewhere very far away.
- Look at the leading digit. A zero at the front means the value is being carried as text, not as a number, which is a fact about the pipeline rather than about the moment.
- Read the column heading or the label beside it before concluding it is a time at all. The digits will not tell you.
What a wrong shape means
A letter, a decimal point, a space or a thousands separator inside the run means the value has been formatted for a human somewhere along the way. Formatted values are for reading, not for computing with, and turning one back into a number is where damage occurs.
A width that is neither ten nor thirteen deserves suspicion of a specific kind: not that the value is fraudulent, but that it is not a time. Eleven digits is a strange thing for a moment to be and an ordinary thing for a reference to be.
The sign is the one that goes wrong silently. A minus dropped in transit turns a moment before the origin into one after it, and the resulting string is entirely well formed.
What a correct shape does not prove
- Not that the number is a time. Any integer of the right width has the right shape, whatever it was actually counting.
- Not which unit it counts. Ten digits strongly suggests seconds and thirteen suggests milliseconds, but a suggestion is not a statement and neither is written anywhere in the value.
- Not that the origin is the one you assume. Systems exist that count from other starting points, and the number looks the same.
- Not that the moment described is real, accurate, or produced by a clock that was right at the time.
- Not that it relates to the page you found it on. A number printed near a paragraph is not thereby about that paragraph.
What this card is not
No conversion table appears here and none is planned, because this reference describes shapes rather than performing calculations. The human readable form of the same information, with all the ambiguity that form introduces, is at a timestamp printed on a page. For numeric strings that are references rather than moments, see an order reference.
Questions people send about this shape
Why does a wrong reading land so far away?
Because the two common widths differ by a factor of a thousand. Reading a thirteen digit value as though it counted seconds multiplies the elapsed span by that factor, which moves the result out of any range a person would call plausible. The string itself is unchanged and perfectly well formed throughout, which is why the fault survives so long unnoticed.
Can a negative value be correct?
Yes. A leading minus simply means the moment sits before the agreed origin, and the shape allows it. It is uncommon enough that some software mishandles it, most often by discarding the sign, which produces a value the same length as the original with a meaning reflected to the other side of the origin. Nothing in the digits records that this happened.