4 ms·
At that time, a total of 1,666,666,693 seconds will have passed since 1970-01-01 00:00:00 GMT as Unix time pretends leap seconds don't exist...
by cygx 4y ago
At that time, a total of 1,666,666,693 seconds will have passed since 1970-01-01 00:00:00 GMT as Unix time pretends leap seconds don't exist...
- lucb1e 4y agoHmmm, 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? (Where a second is as long as every other second, not smearing out the leap second across the whole year. I.e. by the cesium standard definition.) user@debian:~$ qalc "$(date -d 2022-01-01T00:00:00+0000 +%s)"/3600/24/365.25 ((1640995200 / 3600) / 24) / 365.25 = 52 Precisely 52 years' worth of seconds, which I guess also tells me that there have been an integer number of leap years since then. Either way, at 1666666666, 1666666666 seconds will have passed rather than ...693 no? The extra 27 seconds are either for keeping the sun at its zenith when the clock strikes noon (not that that is even close to true where I live, it's off by more than an hour) or for keeping winter in December. I can never remember which, although we already have leap days for keeping December in winter (in this hemisphere) so I think it must be the 24-hour variable rotation speed thing. If you want to define 1666666666 as having +27 seconds passed since 1970 started, you would have to redefine the length of the second every time a leap second is announced, I think. I find this all tough to wrap my head around, though, so it can very well be that I'm wrong here.
- cygx 4y agoHmmm, 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.