3 ms·
> Unix does the sensible thing and records timestamps in seconds since the epoch. If only, but unfortunately that's not how UNIX time works. Instead its more l
by zokier 7y ago
> Unix does the sensible thing and records timestamps in seconds since the epoch.
If only, but unfortunately that's not how UNIX time works. Instead its more like number of days since epoch * 86400 + seconds since midnight. Which is 27 seconds different than simple seconds since epoch count. This is why I would advise against using UNIX timestamps for anything critical because they are fundamentally ambiguous
- zrm 6y ago> Instead its more like number of days since epoch * 86400 + seconds since midnight. Which is 27 seconds different than simple seconds since epoch count. Yeah, the people who decided to do that were Wrong. Fortunately it only really matters during leap seconds, and nothing stops you from doing it the right way and having your timestamps in actual seconds since epoch and then converting to "Unix time" or anything else you need. See e.g. libtai: https://cr.yp.to/libtai.html https://cr.yp.to/libtai.html