https://xkcd.com/2867

Alt text:

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.]

You are viewing a single thread.
View all comments View context
8 points

In the example you gave, wouldn’t the year be off by one when param2.month is 12?

permalink
report
parent
reply
9 points

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.

permalink
report
parent
reply
2 points

Y’know, I legitimately said to myself “I bet they were writing that from memory and just forgot the edge case. I wonder if that was a problem when doing it originally?” before I wrote that comment. 😂 Time to get some Spock tests set up!

permalink
report
parent
reply

xkcd

!xkcd@lemmy.world

Create post

A community for a webcomic of romance, sarcasm, math, and language.

Community stats

  • 1.9K

    Monthly active users

  • 234

    Posts

  • 5.6K

    Comments

Community moderators