2 ms·
> In terms of things like on-disk data structures, don't try to second-guess future interfaces by simply adding padding space for a 64-bit time_t or equivalent.
by twic 9y ago
> In terms of things like on-disk data structures, don't try to second-guess future interfaces by simply adding padding space for a 64-bit time_t or equivalent. The final solution for time handling may not be what you expect and you might just make things worse.
That's pretty unhelpful.
I'll give different advice: store time as leap-second-corrected milliseconds since the standard epoch in a signed 64-bit field. If the Linux maintainers eventually come up with something wacky, write conversion code.
This is the standard format in the Java/JVM world. You might not care about that world, but it at least means this format isn't going away. Any new time convention has to be compatible with this because of the sheer amount of stuff it would break if it wasn't.