Live data from Hacker News

Insane complexity of calendrically correct date and time operations

yourcalendricalfallacyis.com

91–100 of 146 posts

Re: Insane complexity of calendrically correct date and time operations

#91

> Weeks start on Sunday in the United States, Monday in Europe, and a couple of places start on Saturday. Wow. I live in Europe, and find it weird that people can consider the week to start on Sunday. I guess everything that may appear normal within a cultural frame of reference can be off in another, even the most basic of things!

What is the relevance of saying that a week starts on a particular day? In the most common usage, the "week" starts on Monday in the United States, and concludes on Friday, to be followed by the "weekend". A calendar week of 7 days does start on Sunday, but who cares? If they changed how the calendars were printed, life would be different in no way.

In parts of the world, weeks of the year are numbered, so that you can talk about things happening "in week 43", and so on. For such a system, it's of course quite important to agree on which day a new week begins. Also (again, as a European) it feels very odd to not have the weekend (Saturday and Sunday) be at the end of the week, but instead "straddle" between two weeks.

I found the original article a bit strange in it's partitioning of the world into { US, Europe, some places }, I feel that is giving ... undue weight to the US convention, but I haven't studied this to see if I'm right.

Re: Insane complexity of calendrically correct date and time operations

#92
post #89

Wisdom and experience from senior hacker developer "Oh you are working with time and dates that is going to get "complicated"" Lets propose a new time format we could count the number of exoseconds since the beginning of the universe. Then convert that number to whatever native time format we want. Store that as a number and use that for conversion. Age of universe 4.415×10^17 seconds, 4.415×10^26 exoseconds

Not universal enough, areas near a black hole have experienced less time, the CMB has experience 0 exoseconds, even earth and space will slowly diverge. This will just make a lot of future programmer cyborgs very unhappy.

Re: Insane complexity of calendrically correct date and time operations

#93
post #47

The leap second has a history of breaking computers. Pretty much every Linux server running Java broke in 2012, for example. 2009 saw a bunch of Linux kernels crashing in logging code. 2016 was mostly better except for Cloudflare: their systems had an assumption time never runs backwards. https://blog.cloudflare.com/how-and-why-the-leap-second-affe...

There's now "Google time".[1] This handles by leap seconds by making each second slightly longer, starting 12 hours before the leap second and ending 12 hours after it. [1] https://developers.google.com/time/smear

And there's also UTC-SLS.

But a more important distinction than whether you smear over +/-12 hours or +/-1000 seconds is whether you broadcast a bogus time signal to all your hapless servers, which is what Google does, I think, or whether you fix your kernel and C library so that the system knows the real time but reports UTC-SLS to those programs which use the old APIs and are therefore presumed to be incapable of understanding the real time. For example, clock_gettime(CLOCK_REALTIME, &res) might provide UTC-SLS (or whatever) for naive programs while the same syscall with CLOCK_TAI or CLOCK_UTC might give you the actual real time correctly.

Re: Insane complexity of calendrically correct date and time operations

#94

Earlier quoted context omitted.

What is the relevance of saying that a week starts on a particular day? In the most common usage, the "week" starts on Monday in the United States, and concludes on Friday, to be followed by the "weekend". A calendar week of 7 days does start on Sunday, but who cares? If they changed how the calendars were printed, life would be different in no way.

So for all intents and purposes, the week actually starts on Monday in the US, if I understand what you're saying. For instance, if I were to tell you "Beginning of next week, I'm gonna X", you'd understand Monday, correct?

If you said that to me at work, I'd understand Monday, because Sunday is not part of the work week.

I'd likely understand it as Monday in other contexts too, because it's very rare for something to start on Sunday. Monday and Saturday are the transition points and thus the logical places to start doing something.

But I might understand it as Sunday if context seemed to point that way. What I'm saying is that nothing is organized according to "the beginning of the week", so the question of which day is the beginning of the week doesn't have any implications.

Re: Insane complexity of calendrically correct date and time operations

#95
post #91

Earlier quoted context omitted.

What is the relevance of saying that a week starts on a particular day? In the most common usage, the "week" starts on Monday in the United States, and concludes on Friday, to be followed by the "weekend". A calendar week of 7 days does start on Sunday, but who cares? If they changed how the calendars were printed, life would be different in no way.

In parts of the world, weeks of the year are numbered, so that you can talk about things happening "in week 43", and so on. For such a system, it's of course quite important to agree on which day a new week begins. Also (again, as a European) it feels very odd to not have the weekend (Saturday and Sunday) be at the end of the week, but instead "straddle" between two weeks. I found the original article a bit strange i…

In the US, weeks are not numbered, and the way to refer to a week is e.g. "the week of the 10th". (If you're talking about a different month, "the week of September 10th".) You would usually name the Monday of the week because the context is usually work-related.

I question whether "Thursday of week 37" is really that much clearer than "Thursday, September 13".

Re: Insane complexity of calendrically correct date and time operations

#97
Choose a non-Earth-centric time standard. People speculate how a space-faring society would be able to synchronize time and location under relativistic physics. The answer is an intergalactic GPS using far away qusar locations and frequencies. The Voyager probes located Earth for a futrue viewer using a quasar GPS.

Re: Insane complexity of calendrically correct date and time operations

#98

Choose a non-Earth-centric time standard. People speculate how a space-faring society would be able to synchronize time and location under relativistic physics. The answer is an intergalactic GPS using far away qusar locations and frequencies. The Voyager probes located Earth for a futrue viewer using a quasar GPS.

still not stable over long time periods unless you account for stellar drift (which gets more and more uncertain over time)

Re: Insane complexity of calendrically correct date and time operations

#99
post #83
post #72

Earlier quoted context omitted.

The one mistake with UNIX is that UTC is used. It should have been TAI, and leap second adjustment should have been handled by the timezone package (but at the time people weren't worried about leap seconds, so it's understandable). As it is, the system clock has to change . This is as bad as MSDOS time (and other systems which put localtime into the actual RTC). Using UTC as the time reference, independent of local…

Frankly I'm bit confused why civil time in general is based on UTC instead of TAI. Except for astronomy, who does benefit from observing leap seconds?

Civil timekeeping is based on UTC because we want clocks and calendars to remain synchronised with the sun. It's not just astronomers who care about whether the sun is above the horizon. If you think about it, the solar day is the one unit of time that almost everybody cares about and pays attention to. If you screw up the day, you also screw up the week and anything else that is based on counting days. Why would you want to do that?

Re: Insane complexity of calendrically correct date and time operations

#100

The leap second has a history of breaking computers. Pretty much every Linux server running Java broke in 2012, for example. 2009 saw a bunch of Linux kernels crashing in logging code. 2016 was mostly better except for Cloudflare: their systems had an assumption time never runs backwards. https://blog.cloudflare.com/how-and-why-the-leap-second-affe...

This is why some Google and AWS smear the leap second. https://developers.google.com/time/smear https://aws.amazon.com/blogs/aws/look-before-you-leap-the-co...

Imho that's no better. A leap second "smears" the day lengths. Smearing the leap second means introducing changes at some scale, eg. more or less micro- or nanoseconds. Software needs ro be able to cope with this.
Post reply on HN