News for hackers. Stuff that matters.
Re:Falsehoods programmers believe about Unix time by jhayward on Wednesday May 15, 2019 @03:11PM (#19922672)
> come to the conclusion that UTC is flawed

The different time definitions exist to support different use cases. UTC isn't flawed, in fact the adjustments that keep it aligned to solar time are very helpful for its defined use cases.

It's just that time is complicated. If you think you will be doing time math where duration is paramount consider using TAI.

PS: for all those who think 'time' is complicated in fascinating ways, you should fall down the geodesy hole some time. Saying 'where' on earth something is located is .. not simple.

Re:Falsehoods programmers believe about Unix time by 013a on Wednesday May 15, 2019 @04:03PM (#19923170)
Well, time is complicated, but not for reasons that really matter to 99.95% of engineers (relativity and such). At its most basic level, Time is really just a monotonically increasing counter of seconds (or ms or ns or whatever). That's it.

The problem is really the cultural and societal layers on top of it. That's not Time's fault, its Our fault. A "Day" has to be 1 rotation of the earth around its axis, a "Year" has to be 1 rotation of the earth around the sun, etc.

Every unit of time at the Second and below is Simple. Every layer above it is Complex, including the counter of seconds from any date in the past, because Humans are Complex, not because Time is Complex. If we stopped caring that it always has to be cold in Winter (in the US) or that 7am is always morning (well, sunrise changes w.r.t both time and location), or that days are always (usually) 86400 seconds long, our interactions with time would be much simpler.

And, really, given that EVERY SINGLE UNIT above the second has not just some but many special case rules that are instantly confusing, maybe we should stop caring so much.

Re:Falsehoods programmers believe about Unix time by masklinn on Thursday May 16, 2019 @04:01AM (#19927039)
Ah yes, the spherical cow of software development: it's much simpler to build software which interacts with nothing and especially nobody.
Re:Falsehoods programmers believe about Unix time by Dylan16807 on Thursday May 16, 2019 @04:37AM (#19927195)
There's definitely something to be said about overengineering though. No human is going to notice if the clocks all drift together by 1 second per year.
Re:Falsehoods programmers believe about Unix time by IggleSniggle on Wednesday May 15, 2019 @06:30PM (#19924419)
Seconds are only Simple if they are defined as such. If they are defined as a subdivision of the day, then they need to be rebound to the slowing rotation of the Earth as the Earth slows and as relativistic differences due to altitude come into play.

If the second uses some other definition, you still need some centralized authority to define its length, for the same reason that it’s measurement will drift depending on your reference frame.

Re:Falsehoods programmers believe about Unix time by dillonmckay on Wednesday May 15, 2019 @06:00PM (#19924223)
> Every unit of time at the Second and below is Simple. Every layer above it is Complex...

This is an excellent insight. Thanks!

Re:Falsehoods programmers believe about Unix time by chessturk on Wednesday May 15, 2019 @03:29PM (#19922860)
A friend of mine was getting a real estate license and talked to me about the insane ways land ownership is measured, because the curvature of the earth. I believe that was just the tip of the iceburg. I'll have to check out geodesy.

I remember an ancient mathmatician described how all of existence must be a single geometric point, I think it was Euclid, but I can't find it. This all reminds me of that.

Re:Falsehoods programmers believe about Unix time by ergothus on Wednesday May 15, 2019 @03:21PM (#19922781)
> The different time definitions exist to support different use cases. UTC isn't flawed, in fact the adjustments that keep it aligned to solar time are very helpful for its defined use cases.

The user above listed several explicit cases that seem needlessly complicated. Can you give examples where the adjustments to UTC are so helpful for its defined use case? Or elaborate what that case is?

I'm not trying to be obstinate - it's just that without examples your response boils down to "No it's not" without further support. I'm open to being convinced...convince me.

Re:Falsehoods programmers believe about Unix time by jhayward on Wednesday May 15, 2019 @03:30PM (#19922880)
We humans almost always want our concept of "what time is it" to correspond to the relative motion of the sun in the sky. We ask "what time is sunrise?", and "when will the days start getting longer?". We like "noon" to be when the sun is highest in the sky. All those things are what UTC is designed for.
Re:Falsehoods programmers believe about Unix time by toast0 on Wednesday May 15, 2019 @04:38PM (#19923517)
Solar noon varies from 11:53 in November to 12:23 in February where I live (it keeps closer to the hour during DST [1]); an adjustment of 37 seconds doesn't seem to be very big compared to the 30 minute swing we observe over the year. It seems more reasonable to wait until the gap gets large enough to coordinate an hour jump in clocks with enough advance notice that there's a good chance of having it happen simultaneously. At the rate of leap seconds in the last 60 years, that should be several thousand years away; hopefully none of my software is running then.

[1] I'll save the rant on DST.

Re:Falsehoods programmers believe about Unix time by twic on Wednesday May 15, 2019 @05:46PM (#19924102)
We humans, without the use of a clock, do not have the faintest idea when midday or midnight is. We can't judge when the sun is highest in the sky, and we certainly can't judge when it's lowest under our feet.

The sun isn't even highest in the sky at noon! Firstly because of timezones (your noon is based on highest-sun in the middle of your timezone, not your current longitude), and secondly because of this whole epicyclic botheration:

https://en.wikipedia.org/wiki/Equation_of_time

Re:Falsehoods programmers believe about Unix time by bacon_waffle on Wednesday May 15, 2019 @07:56PM (#19924947)
I've been surprised at how "in tune" I've become to time, at times, when I've lived outside for substantial periods. Certainly it's not hard to have better than the "faintest idea" when midday or midnight is, if +/- 30 minutes qualifies? Plenty good to decide when to have lunch...

In the higher latitudes, it requires even less acclimation once you've got an idea of your orientation, and maybe what the stars look like. To the point that, at the poles, a clear sky is a direct-reading 24-hour clock.

Re:Falsehoods programmers believe about Unix time by InitialLastName on Wednesday May 15, 2019 @06:33PM (#19924446)
We sure can judge whether it's before or after sunset though.
Re:Falsehoods programmers believe about Unix time by twic on Thursday May 16, 2019 @06:37PM (#19934146)
Nope. Is sunset when the lower limb of the sun touches the horizon? When it's halfway? When it disappears completely? And is that the actual horizon where the sun happens to be today? The treeline above it? The tower block in the way? Where sea level would be if there wasn't land there? Or just when it gets dark? But then is that civil twilight? Nautical twilight? Astronomical twilight? When the light from the sun gets dimmer than the light from the streetlights that happen to be in your area?
Re:Falsehoods programmers believe about Unix time by msla on Wednesday May 15, 2019 @04:25PM (#19923375)
> We ask "what time is sunrise?", and "when will the days start getting longer?". We like "noon" to be when the sun is highest in the sky. All those things are what UTC is designed for.

The first thing is for time zones, inclusive of DST/Summer Time/etc. The second thing is for calendrical reform, which we've basically stopped doing now that the Gregorian calendar is as widespread as it's going to be. Leap seconds are for this:

https://tycho.usno.navy.mil/leapsec.html

> Currently the Earth runs slow at roughly 2 milliseconds per day. After 500 days, the difference between the Earth rotation time and the atomic time would be 1 second. Instead of allowing this to happen, a leap second is inserted to bring the two times closer together.

The "error" induced by the Earth slowing amounts to 12 minutes over the course of one thousand years.

Re:Falsehoods programmers believe about Unix time by ergothus on Wednesday May 15, 2019 @04:20PM (#19923336)
And the leap seconds meaningfully alter that?
Re:Falsehoods programmers believe about Unix time by lutorm on Wednesday May 15, 2019 @04:33PM (#19923471)
Yes. Leap seconds are there to align UTC (an atomic time) with UT1, which is defined based on mean solar time, ie "the day", since UT1 isn't uniform.

Without leap seconds, UTC will slowly drift out of sync with the Earth's rotation.

Re:Falsehoods programmers believe about Unix time by ergothus on Wednesday May 15, 2019 @04:48PM (#19923621)
That's the point though. The above post said leap seconds cause more harm than good - a correction done once a century would fit well enough within the purpose you've defined here. If UTC is out of sync with the sun by less than a minute, no human will notice, and non-humans don't care about the sun and are happier with fewer disruptions.
Re:Falsehoods programmers believe about Unix time by FabHK on Wednesday May 15, 2019 @06:38PM (#19924481)
I think most applications (including computers, except GPS receivers internally) should just switch to UT1. A rotation of the earth takes a day, and a day has 86400 seconds. Done. (Fine, a second is not exactly an SI second, but close enough for most practical purposes, and computers can handle it.)
Re:Falsehoods programmers believe about Unix time by planteen on Wednesday May 15, 2019 @03:23PM (#19922806)
"UTC isn't flawed, in fact the adjustments that keep it aligned to solar time are very helpful for its defined use cases."

What use case in the year 2019 is made easier by UTC getting leap seconds instead of treating it as a monotonically increasing scale (TAI)? I'm genuinely interested. The only suggestion I have ever heard is use of a sextant -- what an anachronism in the modern world...

Re:Falsehoods programmers believe about Unix time by jhayward on Wednesday May 15, 2019 @03:39PM (#19922969)
See my comment on the other reply.

I'll add in; astronomers like to be able to find objects in the sky using calculations based on time. UTC (actually TT, which underlies UTC) is good for that.

Spend a little time on the various wiki pages for time standards, and think about why those things exist.

https://en.wikipedia.org/wiki/Universal_Time

Re:Falsehoods programmers believe about Unix time by planteen on Wednesday May 15, 2019 @04:01PM (#19923154)
I've spent a lot of time finding objects in the sky to high accuracy with astronomical algorithms. The first step is always converting from UTC to TAI. See Astronomical Algorithms by Jean Meeus if you don't believe me.

Your noon example works for a single longitude in a time zone and the time between subsequent noons on two different days will only be exactly 24 hours 4 times a year. It seems unnecessarily complex to push annual leap second updates to preserve something like as obscure as these 4 events for the 24 time zones exactly on the line of longitude to the accuracy of a second.

See the Wikipedia on abolishing leap seconds, "that the drift of about one minute every 60–90 years could be compared to the 16-minute annual variation between true solar time and mean solar time, the one hour offset by use of daylight time, and the several-hours offset in certain geographically extra-large time zones"

https://en.wikipedia.org/wiki/Leap_second

Re:Falsehoods programmers believe about Unix time by jhayward on Wednesday May 15, 2019 @05:13PM (#19923824)
> The first step is always converting from UTC to TAI

I believe you are actually converting to Terrestrial Time. If there is a correction of TAI+32.184 seconds in your calculation, that would indicate TT.

Re:Falsehoods programmers believe about Unix time by planteen on Wednesday May 15, 2019 @05:25PM (#19923918)
Yes, it is ultimately TT. The order goes: UTC -> TAI -> TT

I could argue the TAI to TT is the second step. But let's put the pedantry aside: Is your best answer of something made easier in the modern world by leap seconds ensuring that solar noon happens at exactly 12:00:00 four times a year on an exact line of longitude for the time zone? And 4 times a year would require a time zone that does not honor daylight time, otherwise it is twice.

I'm not some crackpot here talking about the absurdity of leap seconds. US, China, Australia, Japan, S. Korea are on board for discussions about abolishing to happen in 2023.

Re:Falsehoods programmers believe about Unix time by jhayward on Wednesday May 15, 2019 @05:49PM (#19924130)
> I'm not some crackpot here talking about the absurdity of leap seconds

No question about that; leap seconds have been controversial since they were invented. The question is whether "the juice is worth the squeeze" which is of course an opinion rather than a fact.

The nice thing about time standards of course is that there are so many to choose from. All of them have flaws when you try to use them the way we do in civil time applications.