It's not just time zones and leap seconds. SI seconds on Earth are slower because of relativity, so there are time standards for space stuff (TCB, TGC) that use faster SI seconds than UTC/Unix time. T2 - T1 = [God doesn't know and the Devil isn't telling.]
We use datediff in sql and let God handle the rest.
"Oh but they're in different time zones"
"Oh did you account for if one is in day light savings and other isn't"
"Aren't some of these dates stored in UTC and some local?"
Swatch's Internet Beats are making more and sense every time Daylight Savings forces a timezones change. Why are we still using base 12 for time anyway?
Epoch is your friend, or use UTC. At least that's my layman reasoning. I have no challenges working with DateTime except when I don't know the underlying conditions applied from the source code.
Technically isn't the Earth itself a sort of space ship which is orbiting (...a star which is orbiting...) the black hole at the center of the Milky Way galaxy? Not really close enough for time dilation to be a factor, but still.
All links to the original article are dead and even archive.org doesn't have a capture either. I guess the argument is along the lines of "it might not be relevant, when you're scripting away some tasks for your small personal projects, but when you're working on a widely used library or tool - one day, it might end up on a space vessel to explore whatever."
E.g. my personal backup script? Unlikely. The Linux kernel? Somewhat plausible.
Well in a very strict sense one can't really say "never" (unless you can see into the Future), but it's probably safe to go along with "It's highly unlikelly and if it does happen I'll fix it or will be long dead so won't care".
It’s a programmer thing. As you’re typing the code, you may suddenly realize that the program needs to a assume certain things to work properly. You could assume that time runs at a normal rate as opposed to something completely wild when traveling close to the speed of light or when orbiting a black hole.
In order to keep the already way too messy code reasonably simple, you decide that the program assumes you’re on Earth. You leave a comment in the relevant part of the code saying that this part shouldn’t break as long as you’re not doing anything too extreme.
Ah I've gotten to the point where I have to define what "frame" and epoch each time base is in before I'll touch the representation of time( Unix,Gregorian, etc) .To be honest I'm probably just scratching the surface of time problem.
Hell probably the reason we haven't seen time travellers is we suck at tracking time and you probably need to accurately know your time and place to a very good precision to travel to a given point and we can't say where and when that is with enough accuracy to facilitate where to land. And people don't want to land in the earth's surface or 10000 km away from a stable orbit. Maybe some writer can build that out for a time travel book or to discount it for some reason lol
Then there's continental drift, which as Indiana Jones reminded us this past summer, Archimedes didn't know about when he built his time machine.
Pet peeve: brushing aside the time travel fantasy element, there is not a single shred of evidence of any type of connection between Archimedes and the Antikythera Mechanism.
As if the only person clever enough in Ancient Greece was that one famous dude from Syracuse.
Ionians: "Are we a joke to you?"
I just spent two days debugging a reporting endpoint that takes in two MM-YYYY parameters and tries to pull info between the first day of the month for param1 and the last day of the month for param2 and ended up having to set my date boundaries as
LocalDate startDate = new LocalDate(1, param1.getMonth(), param2.getYear()); //pretty straightforward, right?
//bump month by one, account for rollover, set endDate to the first of that month, then subtract one day
LocalDate endDate = new LocalDate(1, endMonth, param2.year).minusDays(1);
This is extraordinarily simply for humans to understand intuitively, but to code it requires accounting for a bunch of backward edge/corner case garbage. The answer, of course, is to train humans to think in Unix epoch time.
I was transcribing it from memory and that exact problem cost me like two hours when I was writing it the first time. Well spotted, now write me a unit test for that case.
All dates and times shall be stored and manipulated in Unix time. Only convert to a readable format at the top of the UI, and forget trying to parse user inputs :P that's just impossible
LOL whenever I have to work with DateTime systems that try to account for every possibility (and fail trying) I am reminded that in some disciplines, it's acceptable to simplify drastically in order to do 'close enough' work.
I mean, if spherical cows are a thing because that makes the math of theoretical physics doable, why not relativity-free or just frame-constant date-time measures that are willing to ignore exotic edge cases like non-spherical livestock?
Because "relativity" isn't even close to your biggest problem with time. The way we communicate time changes historically, unpredictably, without obvious record. The only way to know what time you're talking about is to know exactly how you got your information. What location, measured at what time relative to recorded changes in the local time zone, with how much drift relative to the last time you synchronized to which ntp server, and so on. These things easily account for hours or days of error, not just nanoseconds.
Not even going to general relativity, as this comics suggests to experience time slowing down due to gravity, the events are not just at time, but also at particular location in space relative particular inertial system. Not specifying it, and not specifying the inertial system for which the final answer is needed makes it impossible to calculate even in special relativity, without effects of gravity.
I wonder what fraction of xkcd readers have already seen this video... I imagine it is quite high. I know I've watched it multiple times. It's a good one.