Oh, what the hell, it's Friday night somewhere.

Let's have a drink.

Which actually reminds me of one of my favorite only-for-software-geeks one-liners:

"Days Since Last Timezone Error: -1"

In 45 years as a programmer, I have, of course, made a genuinely impressive number of stupid choices.

None quite so stupid as trying to handle time and date and days with hand-rolled code of my own.

And tho I'm an excellent programmer, most of whose mistakes have been good learning moments, I have not only tried to handle date and time code myself, but I have tried it multiple times.

"Fool me once, shame on you. Fool me 17 consecutive times over multiple decades, shame on me."

I remember using what was then called joda time (in Java), and what is now the core of java's time system, how amazed I was that it "just worked".

I got the source out, so I could learn the secret.

Here's the secret: there are so many fucking secrets to managing time and date and timezone and intervals you simply would not believe that *anyone* who wasn't an expert could code it.

It's a corner-case *hell*.

@GeePawHill I had a similar experience looking at the source for Noda Time, the .NET port of Joda. And I've been wrong about datetime handling enough times to know that I will never be done being wrong about it.
@GeePawHill Every so often I like to look at the tz database, e.g. for Noth America. It is a genuinely fascinating read, more comments than data, each a story about the hellscape that is managing timezone data. https://github.com/eggert/tz/blob/main/northamerica
tz/northamerica at main · eggert/tz

Time zone database and code. Contribute to eggert/tz development by creating an account on GitHub.

GitHub
@waldoj @GeePawHill this is so interesting, thanks for sharing. Loved the story about El Paso simply ignoring the federal time zone decision, and then the federal government having to accept this and revert the law
@afroisalreadyin @waldoj It's really cool to get inside the layers and layers of historical complexity involved in timezones, *particularly* if your system records date and time across half-century-or-more spans.
@GeePawHill @waldoj I guess all aspects of technical systems have historical patina, it time zones are particularly crazy
@GeePawHill Java.util.Date had links to (now defunct) US Navy sites about time. The one on “Systems of Time” was eye-opening. https://www.cnmoc.usff.navy.mil/Our-Commands/United-States-Naval-Observatory/Precise-Time-Department/The-USNO-Master-Clock/Definitions-of-Systems-of-Time/

@bkoehn @GeePawHill tzdata (the defacto standard timezone library) distributes some html files basically listing off all the edgecases bundled with the source code

Also this for some reason https://data.iana.org/time-zones/tz-art.html

Time and the Arts

@GeePawHill

Years ago, as part of applying for a job, I was given a take-home coding exam that asked me to write some date-manipulation code without using any built-in date libraries.

I used a third-party library instead, along with comments about not reinventing the wheel, especially not for something as complex as manipulating dates.

I got the job.

@Daveography @GeePawHill My interview tip: Not knowing the answer and confessing immediately shows humility. Telling people how you would find the answer shows resourcefulness and a willingness to learn, and that’s just as good, if not better.

I once got hired to solve a customer’s software problem by telling them I had the developer’s cell phone number. :). It turns out I didn’t need it, but it gave the customer the confidence to let me try to fix it.