Live data from Hacker News

You're Wrong About Dates – and Your Code Is Lying to You

metaduck.com

11–20 of 22 posts

Re: You're Wrong About Dates – and Your Code Is Lying to You

#11
post #8

> This isn’t just “nicer syntax” — it’s a fundamental shift in how your software thinks . I’m sorry, I just can’t get past this awful hyperbolic AI drivel.

I don’t think this is related to AI at all. (Unless you’re suggesting it’s AI-generated?) It’s “thinking” as a metaphor for the abstraction being used.

> And it’s not harmless — it leads to broken logic, messy hacks, and subtle bugs that only show up in production.

The AI-specific use of em dash with the list of three near-synonyms following, the "it's not just this", the "it's a fundamental shift". This article seems AI-generated or at the very least AI-massaged.

Once you suspect AI has been used to write something, you're not sure if the 'author' has bothered to double-check the article for veracity, or if you're going to be doing this work for them.

Re: You're Wrong About Dates – and Your Code Is Lying to You

#12
post #4

I forget where I first heard it, but "Dates are not real. Only times with zones are real." When you need to be precise, you specify a time and a zone. When your application has users in different geographies, you need to be precise. Displaying the date attached to a time is a presentational convenience. Only the time is real.

>When your application has users in different geographies, you need to be precise.

depends how important it is. app for tracking celebrity hairstyles forego precision for easy understanding, stock markets precision needed.

Re: You're Wrong About Dates – and Your Code Is Lying to You

#13
post #11
post #8

Earlier quoted context omitted.

I don’t think this is related to AI at all. (Unless you’re suggesting it’s AI-generated?) It’s “thinking” as a metaphor for the abstraction being used.

> And it’s not harmless — it leads to broken logic, messy hacks, and subtle bugs that only show up in production. The AI-specific use of em dash with the list of three near-synonyms following, the "it's not just this", the "it's a fundamental shift". This article seems AI-generated or at the very least AI-massaged. Once you suspect AI has been used to write something, you're not sure if the 'author' has bothered to d…

Humans taught LLMs how to write, and now LLMs are teaching humans how to write.

It's terrible.

> The truth: your current date system isn’t just awkward — it’s wrong. We fixed it. And if that feels unsettling… maybe it’s time your code grew up.

Whoever wrote this (whether carbon or silicon; I lean toward the latter) ... should find another line of work.

Re: You're Wrong About Dates – and Your Code Is Lying to You

#14
My mental model includes both precise moments and intervals. As does PHP’s native date/time functionality, which can do all the same things exemplified in the article. Stop telling me I’m wrong and that you’ve thought of something paradigm-shifting.

Re: You're Wrong About Dates – and Your Code Is Lying to You

#15
This is dangerous nonsense.

Even the example used on the blog post is wrong (in my timezone)...

Start = date(2020-02-23) End = date(2020-04-05)

Duration = End - Start // 42 days Duration as hours // 1008 hours

2020-03-29 was the start of Summer Time, so only 23 hours long. So the duration in question should be 1007 hours.

Having a span of time using days as the only unit is fine. But there no way to convert that into a different time unit without knowing which specific days we mean.

What happens if the duration concerns something that physically moves? Was the software running on a ship that travelled from Europe to Australia between February and April?

Honestly, gushing about how dumb everyone else is, without mentioning even basic wrinkles like this just screams Dunning Kruger.

Re: You're Wrong About Dates – and Your Code Is Lying to You

#16
post #2

Why your mental model of dates is broken, how programming languages gaslight us about time, and how Decipad’s interval-based approach fixes it.

> Every date library you’ve ever used is lying to you.

I feel like you haven't used most date libraries.

https://docs.oracle.com/javase/8/docs/api/java/time/YearMont... / https://docs.python.org/3/library/datetime.html#date-objects / https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: You're Wrong About Dates – and Your Code Is Lying to You

#17
post #8

> This isn’t just “nicer syntax” — it’s a fundamental shift in how your software thinks . I’m sorry, I just can’t get past this awful hyperbolic AI drivel.

I don’t think this is related to AI at all. (Unless you’re suggesting it’s AI-generated?) It’s “thinking” as a metaphor for the abstraction being used.

> Unless you’re suggesting it’s AI-generated?

It’s this. The current crop of LLMs have latched onto a small number of mannerisms that they constantly overuse, along with a weird TEDx voice and belief that everything is game-changing. It wasn’t so bad until recently, but it’s gotten so much worse lately – the overuse of these things would practically be a verbal tic if a human used them so often.

It’s incredibly tiring to read, especially as it uses so many words to say so little. Take this for instance:

> it’s a fundamental shift in how your software thinks.

This is pure, unmitigated horseshit. We’re talking about date representation not a major paradigm shift. But LLMs spit out this crap all the time. It’s not saying anything, it’s just putting one word in front of another.

The human who publishes this should be reviewing it to catch it when it goes off the rails like this, but it seems like it was published with no human oversight at all, or at least none that is able to catch it talking nonsense.

Re: You're Wrong About Dates – and Your Code Is Lying to You

#18
The article clearly aims to be inflammatory, but I'd restate: dates and times are not the same. Ditto for time intervals etc. But lots of libraries skim over this, leading to terrible bugs.

Python date time library, for example, essentially has dates as low precision timestamps. If you subtract a second from a time at midnight, you get what you expect. But subtract it from a date and you are where you started.

You can't add 24hrs to a midnight timestamp to increment date by 1 because DST.

Etc etc.

Re: You're Wrong About Dates – and Your Code Is Lying to You

#19
post #16
post #2

Why your mental model of dates is broken, how programming languages gaslight us about time, and how Decipad’s interval-based approach fixes it.

> Every date library you’ve ever used is lying to you. I feel like you haven't used most date libraries. https://docs.oracle.com/javase/8/docs/api/java/time/YearMont... / https://docs.python.org/3/library/datetime.html#date-objects / https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Java date/time handling is plain beautiful. I'm glad other languages like js started adopting the same approach.

Re: You're Wrong About Dates – and Your Code Is Lying to You

#20

> midnight to 23:59:59 that day. What day is it at 23:59:59.500 then? You're wrong about intervals!

There are occasionally 61 seconds in a minute when they insert leap seconds - or did they stop that to avoid crashing millions of computer systems?
Post reply on HN