221
DateTime (xkcd.com)
you are viewing a single comment's thread
view the rest of the comments
[-] CanadaPlus@futurology.today 1 points 2 years ago* (last edited 2 years ago)

I'm guessing it's not alone. Every time format should come with a distance function and order function, or equivalent. If you have a life, that could mean something like subtraction.

Unfortunately, "should" isn't always enough. Optimally there's also type structure to the return of the function so you can't mix up seconds and days, or calendar and (one of the) standard length days.

this post was submitted on 14 Dec 2023
221 points (96.2% liked)

Programmer Humor

37567 readers
953 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS