4 ms·
Hmmm, am I wrong in understanding that, by pretending leap seconds don't exist, the unix time actually represents how many seconds passed rather than what time
by cygx 4y ago
Hmmm, am I wrong in understanding that, by pretending leap seconds don't exist, the unix time actually represents how many seconds passed rather than what time time is now?
It's the other way around: Unix time pretends every day has exactly 86,400 seconds, and consequently, you can calculate the current time of day by taking the respective modulus.
However, this comes at the cost that the difference between two unix timestamps does not yield a duration in seconds in general.
- joshspankit 4y agoThe choice to go along with leap seconds was one of the bigger crimes against precision...
- cygx 4y agoHowever, it also allows you to re-sync a device just by putting in the current datetime - at the cost that it'll drift at a rate of up to two seconds per year (though the current average is more like 0.5s given 27 leap seconds in 50 years).
- wahern 4y agoThis is also like the Julian Day, used in astronomy (AFAIU), which uses floating point to represent the number of days since an epoch. The fractional part presumes 86400 "seconds" per day. Conversion between Unix Time and Julian Day is a simple, fixed function, as is conversion to proleptic Julian or Gregorian date-times. These types of schemes makes calendrical calculations, both past and future, trivial.
- cygx 4y agoNote that there are different variants of the Julian Date: For example, the Julian Date(Universal Time 1) drifts against Julian Date(Terrestrial Time), with the former being based on Earth's rotation, the latter being an idealized time scale which can be approximated by TAI + 32.184s.