Re:Falsehoods programmers believe about Unix time
by FabHK on Wednesday May 15, 2019 @06:19PM
(#19924337)
Well, depends.
In TAI: A day is 24 hours (86400 seconds always), and a second is a SI second.
In UTC: A day is a rotation of the earth, and a second is a SI second. (And since these are incompatible, we have to introduce leap seconds).
In UT1: A day is a rotation of the earth, and a second is 1/86400 of a rotation of the earth.
Julia, interestingly, uses the UT1 notion, thus avoiding leap seconds, IIRC.
Re:Falsehoods programmers believe about Unix time
by msla on Wednesday May 15, 2019 @07:02PM
(#19924634)
My point is this: Most people don't know about UTC/TAI/UT1 or any other standard. They know what's common knowledge, and what's common knowledge is that one day is 24 hours precisely, one hour is sixty minutes precisely, and one minute is sixty seconds precisely. Therefore, when writing software to interface with most people, including businesses with contracts defined in terms of those time definitions, one day is 24 hours or else you end up with problems.
Re:Falsehoods programmers believe about Unix time
by FabHK on Friday May 17, 2019 @05:36PM
(#19943799)
That's why I advocate using UT1 in programming (like Julia), where all of the above is true. The cost we pay for that is that a UT1 second is not exactly a SI second, but I don't see how that matters except in GPS etc.
Re:Falsehoods programmers believe about Unix time
by IggleSniggle on Wednesday May 15, 2019 @06:23PM
(#19924374)
Well, just to nitpick, seconds do vary in comparative length from reference frame to reference frame...and that actually does start to matter in global computing.
Re:Falsehoods programmers believe about Unix time
by gervu on Wednesday May 15, 2019 @07:46PM
(#19924884)
Seconds don't vary, your approximation of a second varies.
If you want to nitpick, you're going to need to start with Cesium-133 oscillation periods as averaged from over nine billion samples.
Re:Falsehoods programmers believe about Unix time
by IggleSniggle on Wednesday May 15, 2019 @08:42PM
(#19925152)
I like the cut of your jib. But I suppose what I was saying was that, for the purposes of establishing “now”, “now” isn’t really standardizable except with respect to a single inertial frame, and any time-keeping that occurs outside of this inertial frame will not be absolutely in sync, even though it may have a highly accurate measure of time for its own inertial frame.
This matters when computers are bouncing records about time around satellites and across the global.
Edit: I have no idea what I’m talking about so please do not hesitate to correct me on the particulars!
Re:Falsehoods programmers believe about Unix time
by astrange on Wednesday May 15, 2019 @11:28PM
(#19925904)
Seconds do vary because there are no privileged reference frames in the universe. You'll get a different measurement if your cesium measuring experiment is traveling at a different speed than you are.
When you get into the world of programming for most people, businesses especially, a day is defined as 24 hours. We like to think that our days and months and years are tied to vast astronomical forces, for romantic reasons, but when it comes down to it, everything comes back to the second, and the second is defined to be a single unvarying length of time.