Hacker News new | ask | show | jobs
by Minor49er 2295 days ago
1. You could use a float. 2. Probably in the documentation of whatever it is that's using it
4 comments

Floats are ugly because the distance between any two successive numbers are not the same. This makes them inappropriate for discretized time and anything accounting-related (money).
Epoch floats and doubles are not good for timestamps, as the further we get from 1970 the less precise they become.

Current precision with a 32-bit float (JSON/JavaScript are 64-bit usually, though in non-JS it's common to use Bigdecimal in slight non-compliance) is much worse than one second.

> in the documentation of whatever it is that's using it

That's the point, timestamps should be self-describing. If "look up the structure in documentation" suffices we might as well just use protobufs.

1. YUK 2. ISO 8601 is a better format for this.